Combo box Question

D

dimpie

hi-

I have a form that has 2 Combo boxes. Drop1 and drop2

row source for Drop1 is a list of values in a table.
row source for Drop2 is based on what users selects in drop1.

In the form as soon as the user selects a value from drop1, drop2 values
must be refreshed based on the value from drop1.

How do i do this.

any help is greatly appreciated.

Thank you,
 
B

BrerGoose

In the onChange event for ctlCombo1....

Select Case Me!ctlCombo1
Case "Selection 1"
Me!ctlCombo2.RowSource = "qrySelection1"
Case "Selection 2"
Me!ctlCombo2.RowSource = "qrySelection2"
End Select

BrerGoose
 
A

Andy

To refresh Drop2 after Drop1 changes, in the Drop1_AfterUpdate event add

Drop2.requery

This assumes that the drop2 query is already referencing the drop1.value
in its source sql.

hth,
Andy
 
L

Linq Adams via AccessMonster.com

The concept, BTW, is known as "cascading combo boxes."
To refresh Drop2 after Drop1 changes, in the Drop1_AfterUpdate event add

Drop2.requery

This assumes that the drop2 query is already referencing the drop1.value
in its source sql.

hth,
Andy
[quoted text clipped - 11 lines]
Thank you,
 
Top