Combo box to list different values according to the record

G

Guest

Hi everyone,

I have a tabular form. On it I have a combo box named cboType and a text box (which is hidden) named txtType. txtType pulls data from table and it has values 3 or 4. 3 represents "Food", 4 represents "Beverage".

What I want is programmatically change the list of values for the cboType. If I have a 3 in txtType, I want "appetizer" and "entree" to be list of values in cboType. If txtType = 4 then I want "Beer", "Wine" and "Liquor" to be the list of values for cboType. i want this form to be tabular, and the problem I had with that was whenever I changed values for one of the items, all the combo box values changed.

I need suggestions as to how to program this. I think I have to do the requery command at some point but I'm not sure where and how. Please I need your expertise on this.

Thank you very much.
 
R

Rod Scoullar

Al,

By tabular form I assume you mean continuous forms. Since continuous forms
are multiple copies of a single form you can't have different lists in
different copies.
This shouldn't be a problem however because you are only looking at one copy
at a time.

In the Form_Current event change the RowSource of the combobox depending on
the value of txtType. Set the RowSource Type to Value List, and the
RowSource to Beer;Wine;Liquor etc as appropriate.

I hope this will work

Rod Scoullar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top