I'm having a problem with my code. I'm looking for dates on a table and open a form after, so I use this SQL statement to extract the dates.
DoCmd.openForm "frmJan"
With Forms!frmJan
strSQL = "SELECT * FROM [tblKevin]" & _
"WHERE ([entryDate] = # " & (Me.txtReturnDate) & " #);"
.RecordSource = strSQL
End With
It finds any date between 10/04/2004 to 30/04/2004 no problem, but any dates between 01/04/2004 and 09/04/2004 it can't find them at all.
Do I have to change format, and if so how is it done?
thanks
DoCmd.openForm "frmJan"
With Forms!frmJan
strSQL = "SELECT * FROM [tblKevin]" & _
"WHERE ([entryDate] = # " & (Me.txtReturnDate) & " #);"
.RecordSource = strSQL
End With
It finds any date between 10/04/2004 to 30/04/2004 no problem, but any dates between 01/04/2004 and 09/04/2004 it can't find them at all.
Do I have to change format, and if so how is it done?
thanks