I know that Hour is a vb defined code, but it gives me an error when i set a variable = hour. why?
Code:Dim i
i = Hour
Printable View
I know that Hour is a vb defined code, but it gives me an error when i set a variable = hour. why?
Code:Dim i
i = Hour
The Hour() function requires a Datetime argument. If you're looking for the Hour() as of right now, use the Now() function:
i = Hour(Now())
OrCode:Private Sub Command1_Click()
MsgBox Format(Now, "hh")
End Sub
Or
Code:Dim h as Integer
h = Hour(Time)
Oh. That makes sense. Thanks guys!
yea nice !