473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

runtime error 2501 ApplyFilter action was cancelled

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
2 5003
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ColinWard | last post by:
My previous message was blank so Im trying again. I have a button on a form which opens the Import dialogue box. This works fine except if I click on the "X" to close the form I get Run-Time Error...
5
by: Bob | last post by:
Hi Everybody I hope you can help. 2 related questions. 1. I am looking for a way to replace the confusing message box that comes up when a user trys to open a form without putting data in...
0
by: mondo3 | last post by:
Someone had previously created an access 2000 database (tables and forms together in a single .mdb file). The .mdb file was located on a server, and two users (on two separate computers) share...
5
by: fearblanco | last post by:
Hello - I am receiving the below error message when attempting to open a report. This database is used by approximately 20 users and only one user is having this problem (even I can't duplicate...
4
by: Keith | last post by:
I have the following code in the On No Data event of a report: **** On Error GoTo err_trap MsgBox "No items matching criteria.", vbInformation, gcApplication Cancel = True err_trap: If...
33
by: Anthony England | last post by:
I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on...
3
by: fperri | last post by:
Hello, I have a form in Access for users to do updates from. I'm trying to catch the error 2501 that pops up if they say cancel to the prompt that tells them how many records they are going to...
3
by: razjafry | last post by:
Hi, I am trying to create a combo box to search record on the base of ID but it gives runtime error message 2501 "the openform action was cancelled" all the times. I posted this question before but...
7
sassy2009
by: sassy2009 | last post by:
Hello, I am running an insert query from xl spreadsheet using the DoCmd.RunSQL to insert values from the spreadsheet into the Access database. When i run this query it gives an error saying "...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.