filter current date?

yepwingtim

Registered User.
Local time
Today, 09:15
Joined
Jun 6, 2008
Messages
126
sorry really bad at vba thanks

Private Sub Command8_Click()
Dim mystr As String

mystr = "curDate=Date()"

DoCmd.OpenForm "frmEncounterPage"
DoCmd.ApplyFilter "mystr"


End Sub
________
Honda Nr500
 
Last edited:
Look up Docmd.ApplyFilter in Access help.
Syntax Example expression.ApplyFilter(FilterName, WhereCondition, ControlName)
Here is their example DoCmd.ApplyFilter , "LastName = 'King'"
So I suspect your syntax is missing the initial comma to skip the filtername.
Also you do not need the " around mystr
Should be DoCmd.ApplyFilter , mystr

I see that I double posted with pbaldy, his advise is more efficient. Also note the use of the # sign when working with dates.
 
No, # needs to surround date values. If you use my example, you would replace the form reference with the Date() function.
 

Users who are viewing this thread

Back
Top Bottom