bodylojohn
Registered User.
- Local time
- Yesterday, 18:24
- Joined
- Dec 28, 2005
- Messages
- 205
Hello Everybody,
I have searched the net and this forum for an answer but I couldn't find it.
I am trying to filter a continious form in MS Access 2003.
The database field called [DeliverDate] and contains values like "23-7-2015 8:23:16"
In the search field (textbox called txtSearchDate) only a date is entered like "23-7-2015"
If the value in the database field is a date only the filter gives a result. But when the database field [DeliverDate] contains a date AND time NO results are shown.
I use the following code:
I have tried:
if trim(nz(txtSearchDate.value,"")) <> "" then SearchDate = format([DeliverDate],"mm-dd-yyyy") = #" & Format(cdate(me.txtSearchDate.value),"mm-dd-yyyy") & "#"
But that didn't work.
I realy hope you can help me.
Thanks in advance
I have searched the net and this forum for an answer but I couldn't find it.
I am trying to filter a continious form in MS Access 2003.
The database field called [DeliverDate] and contains values like "23-7-2015 8:23:16"
In the search field (textbox called txtSearchDate) only a date is entered like "23-7-2015"
If the value in the database field is a date only the filter gives a result. But when the database field [DeliverDate] contains a date AND time NO results are shown.
I use the following code:
Code:
Private Sub FilterDate
dim SearchDate as string
if trim(nz(txtSearchDate.value,"")) <> "" then SearchDate = [DeliverDate] = #" & Format(cdate(me.txtSearchDate.value),"mm-dd-yyyy") & "#"
me.filter = SearchDate
me.filteron = true
I have tried:
if trim(nz(txtSearchDate.value,"")) <> "" then SearchDate = format([DeliverDate],"mm-dd-yyyy") = #" & Format(cdate(me.txtSearchDate.value),"mm-dd-yyyy") & "#"
But that didn't work.
I realy hope you can help me.
Thanks in advance
Last edited: