Trouble setting filter with VBA

OBBurton

Registered User.
Local time
Today, 04:30
Joined
Dec 26, 2013
Messages
77
Hi,

I'm trying to set a filter with a command button. I've tried to do it like the examples I've read on numerous sites, but I can't seem to get the filter set. The code that seems most like the examples to me is:
Me.Filter = "[chkPaid] = 0"
Me.FilterOn = True
When I run this I get a box telling me to enter a parameter value for chkPaid. chkPaid is definitely the correct name for the checkbox control on the form. I've tried many variations with and without the square brackets, but as long as I have [chkPaid] inside of quotes I get the Enter Parameter box. If I leave the quotes off I get no parameter value request, but it doesn't set the filter either. What am I doing wrong?:confused:
 
Last edited:
You want the name of the field in the data, not the name of a control on the form.
 
Thanks, so much!
That did it! Without your help, I'd be beating my head against a brick wall for who knows how long!
 

Users who are viewing this thread

Back
Top Bottom