Combo box list selection based on earlier selection by user

M

MSA

HI,

I have a form that has a combo box 1 (Product) that reads a the Product
table and has a unique id attached to each product (RO#). There is a second
combo box 2 that is RO#. Now what I would like to do is when a user selects a
Product in combo box 1, the system should lookup the Product selected from
combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I
am using both combo boxes as Unbound and in the combo box 2 I have the two
columns Product and RO# - in the Criteria row of RO# I have the following:

Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![xa_f_lookup]![RO#])

But it does not seem to work as when I select a Product in combo box 1, the
list in combo box 2 is empty. Could some one please guide and assist, thanks.

MSA
 
C

Chris

In the after update event of combo box 1, put the following code:

Me.[combo box 2].requery

Replace [combo box 2] with the name of the control on your form.

HTH,
Chris
 
M

MSA

Hi Chris,

Thanks for your input. When I tried to use your suggestion I keep getting an
error message that Me Macro is not found. Secondly, nothing comes up in the
second combo list as filtered, it shows all.

Let me, try to explain by example as some requirements have also changed:

I have a combo box 1 called Product, having the following enteries each with
a unique RO#:
Product: A Ro#: 1
B 2
C 3

Now, based on the Product selected from the above list an RO# should be
automatically loaded in the RO# field, maybe not a combo box as stated
earlier.
The other thing is that if a user decides to change the selection in Product
combo box prior to saving e.g.

User selects Prod=A
Ro# should be filled with "1"

Now the user decides to change the Product selection to: C
RO# should detect the change update accordingly by filling it with "3".

Please let me how best this can be done, thanks in advance.

Regards,
MSA


Chris said:
In the after update event of combo box 1, put the following code:

Me.[combo box 2].requery

Replace [combo box 2] with the name of the control on your form.

HTH,
Chris

MSA said:
HI,

I have a form that has a combo box 1 (Product) that reads a the Product
table and has a unique id attached to each product (RO#). There is a second
combo box 2 that is RO#. Now what I would like to do is when a user selects a
Product in combo box 1, the system should lookup the Product selected from
combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I
am using both combo boxes as Unbound and in the combo box 2 I have the two
columns Product and RO# - in the Criteria row of RO# I have the following:

Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![xa_f_lookup]![RO#])

But it does not seem to work as when I select a Product in combo box 1, the
list in combo box 2 is empty. Could some one please guide and assist, thanks.

MSA
 

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