Error 2501 Applyfilter
Ask a Question Need help? Post your question and get tips & solutions from a community of 418,509 IT Pros & Developers. It's quick & easy. runtime error 2501 ApplyFilter action was cancelled P: n/a dkohel 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 Post Reply Share this Question 2 Replies P: n/a Salad 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 dkohel 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" Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 05-23-2002, 01:58 PM #1 torok Registered User Join Date: Feb 2002 Location: Canada Posts: 68 Thanks: 0 Thanked 0 Times in 0 Posts ApplyFilter Error 2501 I'm getting an error I can't figure out. My form allows me to apply a filter once (via code), but if I try to do it again when a combo box value changes it complains with an error, saying "The ApplyFilter action was canceled" Anybody encountered this error before? torok View Public Profile Find More Posts by torok 05-23-2002, 02:06 PM #2 torok Registered User Join Date: Feb 2002 Location: Canada https://bytes.com/topic/access/answers/762415-runtime-error-2501-applyfilter-action-cancelled Posts: 68 Thanks: 0 Thanked 0 Times in 0 Posts OK, apparently it happens when after I apply the filter I get no results - but Access thinks I'm making a new record and complains about how it can't resolve the foreign keys. This is really annoying. torok View Public Profile Find More Posts by torok « Previous Thread | Next Thread » Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to http://www.access-programmers.co.uk/forums/showthread.php?t=21428 Threaded Mode Rate This Thread Excellent Good Average Bad Terrible Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Access World Access World News Site Suggestions Introduce Yourself The Watercooler Microsoft Access Discussion General Tables Queries Forms Reports Macros Modules & VBA Theory and practice of database design Access Web Microsoft Access Reference Access FAQs Code Repository Sample Databases Microsoft Access Tutorials Microsoft Access User Groups Apps and Windows SQL Server Crystal Reports Visual Basic VB.NET Word Excel Web Design and Development ASP and ASP.NET PHP & MySQL Windows Other Software Hardware Questions and Answers Non-Access Issues Politics & Current Events Debates Gaming Sports, Health & Fitness Gadgets Small Business All times are GMT -8. The time now is 05:56 PM. Microsoft Access Help General Tables Queries Forms Reports Macros Modules & VBA Theory & Practice Access FAQs Code Repository Sample Databases Video Tutorials Sponsored Links How to advertise Media Kit Contact Us - Home - Privacy Statement - Top Powered by vBulletin Copyright ©2000 - 2016, Jelsoft Enterprises Ltd. (c) copyright 2010 Access World essentially the same. Within each form there are several "tab" pages. On each "tab" page there is an associated filter. So when I click on tab 1, I see only http://www.verycomputer.com/207_e1935f4dac387429_1.htm those records associated with that tab... tab 2 brings up a different set of records, and so on. The problem is this: if I scroll passed the last record in the filter it is http://www.office-forums.com/threads/2501-error-on-docmd-applyfilter.370350/ presumed that I want to add a new record, and all is fine if that is what I really what to do. If I were to unintentionally pass the last record and then try error 2501 to go on to another section of the form (click on a different tab), I get "Run time error 2501. Apply filter action was canceled. You used a method of the CmdDo object to carry out an action in Visual Basic, but then clicked cancel in the dialog box that asked you if you want to save the changes you made to the form." Of course, I'm not error 2501 applyfilter really being asked to save changes nor does a dialog box appear. I really don't want to disable the ability to add records. What I want to do is just be able to ignore the error if there is no data entered for the new record. Interestingly enough, one of the forms in the data base works exacting the way I'd like. The rest produce the error above. All of the forms appear to be subsets of the working form. All access the same table. The only appreciable difference being that the working form accesses the table directly where the problem forms use a query. Any suggestions? Dallas Hudson Top 1. Runtime Error 2501: Apply filter action was cancelled I have a database with several forms which are essentially the same. Within each form there are several "tab" pages. On each "tab" page there is an associated filter. So when I click on tab 1, I see only those records associated with that tab... tab 2 brings up a different set of records, and so on. The problem is this: if I scroll passed the last record in the filter it is presumed that I want to add a n