Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ApplyFilter error

Status
Not open for further replies.

simon1974

Technical User
Apr 2, 2002
43
US
I am using the following syntax to filter on a checkbox field:

DoCmd.ApplyFilter , "[Report] = 'Yes'"

I get the following error when the code executes:

Runtime error 2501
You used a VB method but then clicked cancel in a dialog box. (which I haven't done)

Any suggestions?
 
I may be mistaken but in your code
DoCmd.ApplyFilter , "[Report] = 'Yes'"
if [Report] is a checkbox then its value is a boolean and 'Yes' is a string. Try it without the single quotes around Yes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top