Filtering a combo box from another combo box

beanhead0321

New Member
Joined
Jul 8, 2011
Messages
14
I realize this is everywhere on the internet, but I can't seem to get mine to work. I have two combo box, first one is called Name, second is called Model. In the query for model under criteria for Name, I have [Forms]![Form1]![Name] for reference for the query. When I put in a value in Name and run the query, I pick up nothing. The Name combo box gets info from a table called Categories and the second combo box gets info from the query which refers to a table called Inventory. When I run the query after selecting a value for the first combo box, I get nothing in my query. Do I need to create a relationship between the two tables? What am I doing wrong?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Assuming that everything is laid out correctly, you are probably missing the bit where you requery the second combo.

In the Name combo, go to the Properties. Select the Events tab, double-click the After Update line so you see [Event Procedure], then click the ... button at the end of the row to go to the code.
In between the Private Sub and End Sub lines, put this:

[Model].Requery

(assuming that Model is the name of the second combo).

Denis
 
Upvote 0
That didn't work... As of right now though, I do not have a relationship between the my two tables (category and inventory). Do I need to establish a relationship (one to many) from category to inventory? I tried to do one between the ID field in category and the name field in inventory, but it says my relationship must "be on the same number of fields with the same data types." I don't really know what to do at this point.
 
Upvote 0
Also, is there a way to refer to a specific cell in vba in access? Like in excel you can go
Sheet1.Range ("A1") to refer to A1
Can you do this in access? I also need to make a button to text from a textbox to a specific cell. (The one that would be on the same row as the name and model taken from the combo box).
I know how to do this in excel, but access seems to be completely different. Thanks for the help in advanced.
 
Upvote 0
I got the combo boxes to work! Thank you very much. Your website was really helpful. Now I just don't know how to refer to a specific box. This form is for inventory. One of the textboxes will ask for a number to be inputted. This number will then be subtracted from the total number that is associated with the item that is selected.
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,912
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top