VBA filter Syntax

bleep-blop

Registered User.
Local time
Today, 10:02
Joined
Sep 30, 2013
Messages
24
Hi, very quick question.

This filter vba doesnt work

Code:
Me.Filter = "abcode= " & i And "EmpASID = " & f
Me.FilterOn = True

runtime error 13 type mismatch.

Both Abcode and EmpASID are Numerical.

So is i and f

Code:
Me.Filter = "abcode= " & i
works fine on its own
Code:
Me.Filter = "EmpASID = " & f
works fine too on its own


little bit baffled lol

I cant figure out where i have gone wrong for the syntax.

any help would be greatly appreciated :):D
 
You need to concatenate the String with values..
Code:
Me.Filter = "abcode= " & i [COLOR=Red][B]& " [/B][/COLOR]And EmpASID = " & f
Me.FilterOn = True
 
Ah thank you so much :) always feel silly when it something that simple lol Cheers :)
 

Users who are viewing this thread

Back
Top Bottom