[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Access 2003 - Combo box does not filter form after using toolbar (or right-click) remove filter.

Posted on 2011-10-31
Medium Priority
Last Modified: 2013-11-28
Have a continuous form that has a combo box to filter for records by name.  It works until you use remove filter using the toolbar or right click method.  
Question by:mlaurin
  • 5
LVL 77

Expert Comment

ID: 37058175
Please post the code for the combo box (combobox afterupdate event procedure I would expect)

Author Comment

ID: 37058424
Here it is:

Private Sub Analyst1_AfterUpdate()
End Sub
LVL 13

Accepted Solution

lee555J5 earned 2000 total points
ID: 37058623
Is Analyst1 the name of the combobox?

If it is, replace the whole Sub with the attached code.

Build your filter statement based on the BoundColumn of the combobox.

If the combobox has only 1 column (LastName) and the form has a LastName field,
filter_expression: "LastName = " & Chr(39) & Analyst1 & Chr(39)

If the combobox has 2 columns (EmployeeID and EmployeeName) and the bound column is the first,
filter_expression: "EmployeeID = " & Analyst1

The Chr(39) is the single quote and it is usually clearer to use this instead of stacking lots of single and double quotes together. Use single quotes to equate strings.


Private Sub Analyst1_AfterUpdate()

  Me.Filter = Put your filter_expression here
  Me.FilterOn = True

End Sub

Open in new window

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.


Author Comment

ID: 37058889
That worked!  I originally put the filter in the query field which works great except if used in combination with the toolbar filter.  So thanks for the solution that does work.

Author Comment

ID: 37059035
I've requested that this question be closed as follows:

Accepted answer: 0 points for mlaurin's comment http:/Q_27424025.html#37058889
Assisted answer: 500 points for lee555J5's comment http:/Q_27424025.html#37058623

for the following reason:


Author Comment

ID: 37059023
Made a mistake with accepting.  Not sure how it happened that my comment shows as accepted.  It should only be ee555J5's.  
Will try to figure out how to change this!

Author Comment

ID: 37059036
Made a mistake with accepting.  Not sure how it happened that my comment shows as accepted.  It should only be ee555J5's.  

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question