ActiveX calendar 7 object returning incorrect values

mazza

Registered User.
Local time
Today, 13:40
Joined
Feb 9, 2005
Messages
101
I have a bound form, which is based on possible available workdates (unique dates).
In the form I have an unbound activeX calendar7 that I use to select a date and then go to the record for that specific date

I use the following on click event to find and go to that record:
Private Sub Command13_Click()
Dim rs As Object
mydate = getSQLDate(Calendar7, "dmy")
Set rs = Me.Recordset.Clone
rs.FindFirst "[Worksdate] = #" & mydate & "#"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

The problem is that it seems to get terribly confused with the US format MDY and seems to want to return this. No matter where I try to define that it should use the DMY format

Is this because I have my RS declared as object rather then a date?
If so how do I correct this
 
Is this because I have my RS declared as object rather then a date?
If so how do I correct this

Your problem is that VBA works with dates in the US format, leave the format option or use the US format.

Note:
The variable mydate is not declared if you set option explicit at the top of your module you should have declared it (as date).
 

Users who are viewing this thread

Back
Top Bottom