me.filter not working

wrweaver

Registered User.
Local time
Yesterday, 16:04
Joined
Feb 26, 2013
Messages
75
I have a bound continuous form that has a form filter on load that filters the control workerid that is set to "WorkerID = 2." I want to have a button that filters another control (StartTime) by today's date while still maintaining the initial filter. I thought the code would be

Code:
me.filter = "StartTime=" & Date
 me.filteron = true

BUT when I run the code it makes all the records disappear. Is this the wrong code?
 
Does the StartTime field include the time? If so, only midnight would match the date alone.
 
Yeah the date and time are stored with format mm/dd/yy hh:nn am/pm
 
Does that mean there's no way to filter it?
 
Try

me.filter = "DateValue(StartTime)=#" & Date & "#"
 
Code:
Me.Filter = "StartTime=" & mdlUtilities.ISODate(Date)
;)
 
Thanks that worked perfectly but how would I enter that as criteria in a query?
 
Which answer are you referring to (I think I know)? And why would it need to be a criteria?
 
I was referring to your answer and nevermind youre right. I can just use the filter in the form instead of including it in a query.
 

Users who are viewing this thread

Back
Top Bottom