options on one variable to depend on input of another

G

Guest

In our database, we wish to have the following:
item #1 is either yes/no. Item #2 has 5 possible values, say, A,B,C,D, and E.

We want it to behave as follows:
if the user inputs item #1 as yes, then Item #2 will only allow C,D, or E as
possible values (ideally, in adjacent drop down list)
if the user inputs item #1 as no, the Item #2 will allow only A,B,or C as
possible values.

I would appreciate help, even if it's to a reference to the type of control
I need to look up for this situation.
 
G

Guest

In your form you create to fields
1. check box to except yes/no (Item #1)
2. combo box, with the following properties: RowSourceType = Value List
(Item #2)

on the after update event of field one write the following

if me.item1 = true then
me.item2.RowSource = "C,D, E"
else
me.item2.RowSource = "A,B,C"
endif

also on load event of the form you should call the sub of the after update
of field1, that way the values in field 2 will set.
 

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