I have a table that contains a field "Date" the format for this field is dd/mm/yyyy ie 01/01/2003. From this table I would like to get the all the dates that fall between 01/01/2003 and 31/01/2003. I have started with a form that has a combo box on it for the start date. I currently have the user select the require date form the list. From there I have started to code an event procedure that looks like this.
Private Sub Cbo_FindDate_BeforeUpdate(Cancel As Integer)
Dim strWhere As String
strWhere = "Format(MyreGracePA.Date, 'ddmmyyyy')= '" & Format(Cbo_FindDate, "ddmmyyyy" & "'"
MsgBox DLookup("Date", "FindMonth_tbl", strWhere)
If ((DLookup("Date", "FindMonth_tbl", strWhere))) <> 1 Then
Cancel = True
End If
End Sub
But some where a long the line I have missed some thing because I am getting an error any ideas as to where I should be look at in order to fix the error or am I off track with this idea. Any thoughts would be greatly appreciated.
Kind Regards Nicolle
Private Sub Cbo_FindDate_BeforeUpdate(Cancel As Integer)
Dim strWhere As String
strWhere = "Format(MyreGracePA.Date, 'ddmmyyyy')= '" & Format(Cbo_FindDate, "ddmmyyyy" & "'"
MsgBox DLookup("Date", "FindMonth_tbl", strWhere)
If ((DLookup("Date", "FindMonth_tbl", strWhere))) <> 1 Then
Cancel = True
End If
End Sub
But some where a long the line I have missed some thing because I am getting an error any ideas as to where I should be look at in order to fix the error or am I off track with this idea. Any thoughts would be greatly appreciated.
Kind Regards Nicolle