Formatting Now()

Cosmicnoodle

Registered User.
Local time
Today, 15:13
Joined
Jun 14, 2005
Messages
33
Is there any way to format the result when using Now() in VBA

Private Sub cmd_Today_Click()

tbo_DateTo = Now()

End Sub

I am using the above code to put todays date into a textbox on a form, but it gives me the format dd/mm/yyyy hh:mm:ss. I simply want dd/mm/yyyy.
 
Code:
tbo_DateTo = Format(Now(),"dd/mm/yyyy")
 
cheers - thats perfect... ta
 
ghudson’s reply will work most of the time but it does depend on regional settings.

Me.tbo_DateTo = Format(Now(), "dd\/mm\/yyyy")

The above will force the forward slash irrespective of regional settings.

Hope that helps.

Regards,
Chris.
 

Users who are viewing this thread

Back
Top Bottom