Combo box value depends on the selection of another combo box

Pettor

Board Regular
Joined
Aug 8, 2015
Messages
175
Good morning to All,

I have an "order form" through which I enter data to a table.

There are two combo boxes that are related to each other, one is the "category of a product" and a second one which contains the "products".

When I am placing an order to a customer, first I choose the category of a product and then the product itself from the second field.

I followed this link in order to do it. https://www.youtube.com/watch?v=rdAqkg6bGT0&t=213s

My problem is that although I have entered the values on the second combobox, when I am going back and forth to the records through the form, I see only the category values on the first field and not the product related, although it is normally registered to the table.

When I go to the first box (category) and select again the same category, the registered value of the product appears in the related combobox for all the records that are related with this category, but the products that are connected with all the other categories disappear again to their records until I choose again the "category value" on a given record.

Then all the values related with the selected value appear and the others are lost.

Any thoughts on this?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
The query of Products looks at Cata.
select prod from tProds where Cata =forms!myForm!cboCata

then when the user picks the cboCat, you must refresh cboProd to see the pick....
Code:
sub cboCata_afterupdate()
CboProd.requery
end sub
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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