Results 1 to 2 of 2
  1. #1
    DavidMadge
    Guest

    ApplyFilter & Error 2501 ((Access97, SR-2))

    I have a main form whose data source is a query that links 10 tables together. Some of the fields in the query are shown on the main form in combo and list boxes, allowing me to select a particular record in the query. The main form is largely a tab control that carries 9 subforms. These subforms are populated from a range of tables, either directly or via queries. The records shown in any particular subform are filtered by a Master/Child field linkage between the subform and one of the main form's combo or list boxes. I want to add a new combo box to the form to allow me to select a value from one of the fields in the main form's datasource query and apply a filter to the main form based on that field value, eg:

    DoCmd.ApplyFilter , "[LicenceHealthCode]='" & Me![cboLicenceHealthView] & "'"

    where [LicenceHealthCode] is a field in the main query and [cboLicenceHealthView] is the combo box I use to set the filter value. When I select a value from the combo box I get Runtime error 2501 (ApplyFilter action was cancelled). Any suggestions as to where I should look for the cause, based on my scant description of what is quite a complex form ?

    David

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ApplyFilter & Error 2501 ((Access97, SR-2))

    You'll have to set breakpoints in your code and try and determine exactly when you're getting the 2501 error. Unfortunately, that's an error that can often occur for less than obvious reasons and you haven't provided enough of your code to give any hint as to what the reason was. You might also try a Lounge search on 2501 and on ApplyFilter to browse through existing threads on this error.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •