Multiple Where Conditions on Form Filter

rnutts

Registered User.
Local time
Today, 04:31
Joined
Jun 26, 2007
Messages
110
[FONT=Verdana, Arial, Helvetica]Hi

I have a form based on a query. I wish to apply more than one filter to the
form.I am using the docmd.applyfilter event. I have created two filters
strcriteria and strcriteria2. If I apply these seperately they work fine, if
I use then consecutively then only the latter applies. I have tried the code
below but I get an error message saying 'Type Mismatch'
Can someone take a look and give me a way around this problem
Workdate is a date field, so when got error message first time I converted
to a number to see if this solved the problem, actual date is 1/11/2009

Dim strCriteria As String
Dim strCriteria2 As String

strCriteria = "recordinvoiced=" & 0 & ""
strCriteria2 = "Workdate > " & 40118 & ""

DoCmd.ApplyFilter , strCriteria2 And strCriteria


Thanks

Richard
[/FONT]
 
DoCmd.ApplyFilter , strCriteria2 & " And " & strCriteria

You need to apply the And statement correctly
 
many thanks

Richard:)
 

Users who are viewing this thread

Back
Top Bottom