Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box depending on previous combo box 1

Status
Not open for further replies.

davidmo

Technical User
Apr 8, 2003
97
US
I have a form that is bound to a table (tblConcierge) and there are two combo boxes (both unbound). The second combo box (cboFull_Name) is based on what is selected in the first combo box (cboType). The lists of the two combo boxes are in two different tables. I've read a number of threads and still having problems.

I put in the AfterUpdate event for cboType the following code:
Private Sub cboType_AfterUpdate()
Me.cboFull_Name.RowSource = "SELECT Last_Name FROM" & _
"tblGeneralList WHERE Type=" & Me.cboType & _
"ORDER BY Last_Name"
Me.cboFull_Name = Me.cboFull_Name.ItemData(0)

End Sub

I get a list in cboType and able to select but no list shows up in cboFull_Name.

Help!!

Thanks.
DMO
 
Lack of spaces :
Me!cboFull_Name.RowSource = "SELECT Last_Name FROM" & _
" tblGeneralList WHERE Type='" & Me!cboType & "'" & _
" ORDER BY Last_Name"

If Type is defined as numeric in tblGeneralList then get rid of the single quotes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top