I'm just trying to filter out the data in the form field which is pulling from a table. I have a combo box set up but I can't get it to filter the data out.
Main Topics
Browse All TopicsI'm trying to apply a form filter using a combo box to my "Carrier Number" field. I'm using a table, not a query because I need it to filter out all the other data so the user can view the selected carrier number and make changes to the table.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
First, make sure the combo box does not have a control source. Second, make sure the bound column of the combo box is the one you want to filter on. Third, reference the combobox in a WHERE clause of the form's underlying record source. Fourth, requery the form in the afterupdate event of the combobox.
Wow, you lost me.
Okay, The combo box does not have a control source. The bound column is "2" and it is the second field on the form. Not sure if that has anything to do with it. I'm not sure what you talking about on the WHERE clause of the form's underlying record source. Then what do I put in the afterupdate?
>The bound column is "2" and it is the second field on the form.
Position on the form makes no difference. Bound column 2 means that the combo box takes its value from the third column of its row source. That column should contain the value you want to filter on.
Go to the data tab on the form's property sheet. What is the record source?
In the afterupdate event of the combobox, include this:
me.Requery
>I reset the bound column back to 1 so it will look at the 2nd field in the form.
Field position in the form is NOT important. The combobox has a rowsource property. Set the bound column to the appropriate column in the rowsource. Relative to zero, as you already know.
>I went to the form data and the record source is "Carrier Tool Location"
Now you need to apply your combobox selection to limit the record source. There are two approaches. The first uses the filter property of the form. That's the easiest, but I stay away from that approach because some usersl figure out how to toggle on/off the filter and mess things up.
The second approach is to put a condition on your record source. Change the record source to this:
Select * from [Carrier Tool Location] where [Carrier Number]=Forms!YOURFORMNAME
If you'd prefer to see all the rows when the combo box is not selected, then add this expression to the end of the record source:
or Forms!YOURFORMNAME!YOURCOM
I tried the second approch and I got an error message
Error Message:
Syntax error (missing operator) in query expression '[Carrier Number]=Forms!Carrier Tool Location!CarrierFilter'.
I have in the record source:
Select * from [Carrier Tool Location] where [Carrier Number]=Forms!Carrier Tool Location!CarrierFilter
Use square brackets around your form name that contains spaces:
Select * from [Carrier Tool Location] where [Carrier Number]=Forms![Carrier Tool Location]!CarrierFilter
I am assuming [Carrier Number] is indeed a numeric datatype.
Also, best practice is to avoid spaces in all of your access names: tables, forms, queries, controls, etc. Following that practice makes Access a lot more friendly.
Okay, that seemed to work because I can open my form now. Before I couldn't open it. Now I'm getting "Microsoft Office Access can't find the macro 'me.' This is in that combo box when I scroll down and select the carrier number I want to view. After I select it, I get this error and it doesn't filter.
Also, the carrier number is not a numeric datatype, it has to be text because some of the numbers start with a 0-
>"Microsoft Office Access can't find the macro 'me.'
The AfterUpdateEvent property of the combo box is a dropdown. Click on it, and select EventProcedure from the dropdown list. Then click on the ... to open up the VBA editor. Type in "me.requery" there. It should look like this:
Private Sub Carrier_Tool_Location_Afte
Me.Requery
End Sub
Business Accounts
Answer for Membership
by: dqmqPosted on 2008-09-09 at 09:22:52ID: 22429130
Welcome to the Access: the most fleet IDE in the world. How can we help?