populate combo box dependent on bound text box

flavi

Avg Access Guy
Local time
Today, 01:29
Joined
Jun 16, 2008
Messages
14
Hello:

I know how to populate 2 combo boxes that are unbound, but would like to know how to populate a combo box based on a text box that is bound.

My code is:
Code:
Me.cboOEM.RowSource = "SELECT fldOEM FROM" & _
                               " tblOEM WHERE fldDISTRIBUTOR = " & _
                               Me.txt18.Value & _
                               " ORDER BY fldOEM"
                            
    Me.cboOEM = Me.cboOEM.ItemData(0)

txt18 is a number(and primary key) as well as fldDISTRIBUTOR is a number as well. These 2 fields are identical. fldOEM in the table is a text field. The goal to achieve is when the record is viewed, a combo box lists all of the OEMs related to the record.

Any suggestions? I am doing this in an After Update function.

I appreciate any help.

Thanks,

Bradley
 
you'll have to SELECT both fields from your table to use them.
you could create a query in the design grid and apply that as the row source as needed.
 

Users who are viewing this thread

Back
Top Bottom