Dates help

neilmcmor

Registered User.
Local time
Today, 22:23
Joined
Aug 9, 2007
Messages
70
I have a date field in a table that I store dates in UK format, (DD,MM,YYYY). I have aform with a command buttong that is supposed to open another form at a particualr record based on the date field. However if the day part of the date field is over 12 then no record is returned. For example when trying for 02/11/07 I am assuming Access is looking for 11th Feb 2007. How do I solve this?
 
I am using the following code to open the form which is obviously having the effect of access looking at american format. Can it be changed?

DoCmd.OpenForm stDocName, , , "[Class_Date]=#" & Me!Class_Date & "#
 
I posted the answer for this in your other post. But, for others looking:

DoCmd.OpenForm stDocName, , , "[Class_Date]=#" & Format(Me!Class_Date,"mm/dd/yyyy") & "#"
 
Excellent. I spent ages trolling the net but I was giving up hope as all I could find on this problem led me to believe it could not be overcome when using Dates with VBA. Thanks Bob
 

Users who are viewing this thread

Back
Top Bottom