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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a combo box from another combo box

Status
Not open for further replies.

Cachelot

Programmer
Jan 30, 2001
15
0
0
CA
I want to populate the second combo box "cmdSubCategory" from the first combo box

"cmdCategory". I have placed the following code in the "Private Sub

cmbCategory_Change()" section..

Dim ListData As String
ListData = "SELECT [SubCategories].[SubCatID], [SubCategories].[SubCategory] FROM

SubCategories WHERE [SubCategories].[CatID]=" & cmbCategory & ";"
Me!cmbSubCategory.RowSource = ListData

This works fine if I use the mouse and select a Category but if I type in a

Category the cmdCategory gets filled in as I type but when I Press enter the

second combo box does not get populated. Any suggestions??

I really need the help...
 
Put this in the AfterUpdate event of your cmbCategory combobox.

ntp
 
Thanks for the help "ntp". I really appreviate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top