kengooch
Member
- Local time
- Yesterday, 17:27
- Joined
- Feb 29, 2012
- Messages
- 137
I want to filter a form by a specific date.
I have created an unbound text box that filters records by several different fields by whatever text string I type in to a text box. I then execute the filter with a Command Button. I have tried to use this same concept with a date field but it doesn't work.
Here is the info on the filter that works.
Form = fSendLogLst
Unbound Text Box = luSrchAll
Command button = bSearchAll
On Click / Macro / Where Condition = [tSOPatientNm] Like "*" & [Forms]![fSendLogLst]![luSrchAll] & "*" Or [tSOPatSSN] Like "*" & [Forms]![fSendLogLst]![luSrchAll] & "*" Or [tSOAccNo] Like "*" & [Forms]![fSendLogLst]![luSrchAll] & "*"
This works just fine. So I tried to modify it for use with the date.
Form = fSendLogLst
Unbound Text Box = luDate
Command button = bSrchDate
On Click / Macro / Where Condition = [tSODateSent]="#" & [Forms]![fSendLogLst]![luDate] & "#"
Obviously my syntax is wrong. Any thoughts?
Should I try to write this in VBA or can the macro be corrected?
Thanks so much for any help.
Ken
I have created an unbound text box that filters records by several different fields by whatever text string I type in to a text box. I then execute the filter with a Command Button. I have tried to use this same concept with a date field but it doesn't work.
Here is the info on the filter that works.
Form = fSendLogLst
Unbound Text Box = luSrchAll
Command button = bSearchAll
On Click / Macro / Where Condition = [tSOPatientNm] Like "*" & [Forms]![fSendLogLst]![luSrchAll] & "*" Or [tSOPatSSN] Like "*" & [Forms]![fSendLogLst]![luSrchAll] & "*" Or [tSOAccNo] Like "*" & [Forms]![fSendLogLst]![luSrchAll] & "*"
This works just fine. So I tried to modify it for use with the date.
Form = fSendLogLst
Unbound Text Box = luDate
Command button = bSrchDate
On Click / Macro / Where Condition = [tSODateSent]="#" & [Forms]![fSendLogLst]![luDate] & "#"
Obviously my syntax is wrong. Any thoughts?
Should I try to write this in VBA or can the macro be corrected?
Thanks so much for any help.
Ken