By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,220 Members | 1,633 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,220 IT Pros & Developers. It's quick & easy.

runtime error 2501 ApplyFilter action was cancelled

P: n/a
What is wrong with the following code?
I am trying to filter a form based on the selection of a combobox
named cblPRD

Dim currentFilter
currentFilter = "[prdID] = '" & Me!cboPRD & "'"
Filter = currentFilter
DoCmd.ApplyFilter , Filter

When the code executes, I trap and receive the following error...

Error Number: 2501
Error Description: The ApplyFilter action was cancelled
Jan 23 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
dk****@gmail.com wrote:
What is wrong with the following code?
I am trying to filter a form based on the selection of a combobox
named cblPRD

Dim currentFilter
currentFilter = "[prdID] = '" & Me!cboPRD & "'"
Filter = currentFilter
DoCmd.ApplyFilter , Filter

When the code executes, I trap and receive the following error...

Error Number: 2501
Error Description: The ApplyFilter action was cancelled
I sometimes set filters with code similar to

Me.Filter = "ID = 123"
Me.FilterOn = True

Twilight Zone
http://www.youtube.com/watch?v=a1sf2CzEq0w
Jan 23 '08 #2

P: n/a
Seems as though this issue only occurs when I have the prdID set as a
primary key. When I remove the primary key setting on that field, it
works fine. Any ideas why?

On Jan 22, 8:23 pm, "dko...@gmail.com" <dko...@gmail.comwrote:
What is wrong with the following code?
I am trying to filter a form based on the selection of a combobox
named cblPRD

Dim currentFilter
currentFilter = "[prdID] = '" & Me!cboPRD & "'"
Filter = currentFilter
DoCmd.ApplyFilter , Filter

When the code executes, I trap and receive the following error...

Error Number: 2501
Error Description: The ApplyFilter action was cancelled
Jan 24 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.