I want to code a date search when my access 2003 form loads. The code will search for the first date in a series of records that matches the current date. The search field in the database is 'Date'. Even though the formatting of 'Date' and 'Now' appears the same I do not find a match. 'Date' is formatted to medium date in my table.
Dim Mydate As Date
Mydate = Format(Now(), mediumdate)
DoCmd.GoToRecord , , acFirst
STARTDateCHK:
If Mydate = [Date] Then
GoTo Done
End If
DoCmd.GoToRecord , , acNext
GoTo STARTDateCHK
Done:
End Sub
Dim Mydate As Date
Mydate = Format(Now(), mediumdate)
DoCmd.GoToRecord , , acFirst
STARTDateCHK:
If Mydate = [Date] Then
GoTo Done
End If
DoCmd.GoToRecord , , acNext
GoTo STARTDateCHK
Done:
End Sub