i have a search form which seems to work fine.
user can select name or dates (from and to)to search
for specific log.
one problem. i created a command button which pops a calendar so user can easily click on the dates.
and it works fine. but for some reason, if user manually types in the date, i get a "type mismatch" error...
If Not IsNothing(Me.txtFromDate) Then
varWhere = (varWhere + " AND ") & "[LogDate] >= #" & _
Format(Me.txtFromDate, "dd mmm yyyy") & "#"
End If
If Not IsNothing(Me.txtToDate) Then
varWhere = (varWhere + " AND ") & "[LogDate] < #" & _
Format((Me.txtToDate + 1), "dd mmm yyyy") & "#"
End If
error is occuring on last 2 lines (varwhere = ...)
any idea what im doing wrong?
user can select name or dates (from and to)to search
for specific log.
one problem. i created a command button which pops a calendar so user can easily click on the dates.
and it works fine. but for some reason, if user manually types in the date, i get a "type mismatch" error...
If Not IsNothing(Me.txtFromDate) Then
varWhere = (varWhere + " AND ") & "[LogDate] >= #" & _
Format(Me.txtFromDate, "dd mmm yyyy") & "#"
End If
If Not IsNothing(Me.txtToDate) Then
varWhere = (varWhere + " AND ") & "[LogDate] < #" & _
Format((Me.txtToDate + 1), "dd mmm yyyy") & "#"
End If
error is occuring on last 2 lines (varwhere = ...)
any idea what im doing wrong?