Combo Box Question

brokenwh

Registered User.
Local time
Yesterday, 18:30
Joined
Jul 31, 2003
Messages
15
I am creating a combo box that selects its list based on input from another combo box. I have done this several times before, but I am getting a "Missing Operant" error message and am not having any luck trying to get it fixed.

Here is my code:
Private Sub Combo60_AfterUpdate()
Me.Combo62.RowSource = "Select [Project],[ProSubCat] from [ProjectSubCategories] Where [Project]=" & Me.Combo60
Me.Combo62.Requery
End Sub

All of these are "text" in case that makes a difference.

Any help would be appreciated and Thanks
 
What type of data is in Combo60? If it's text, you should try:
Me.Combo62.RowSource = "Select [Project],[ProSubCat] from [ProjectSubCategories] Where [Project]='" & Me.Combo60 & "'"
 
Thanks

The information in the combo boxes are text and I reworked the code as you suggested. I am still getting an error message stating.
Syntax error (missing operator) in query expression '[Project]=Supplies'.

Any other ideas that I am doing wrong?
Private Sub Combo60_AfterUpdate()
Me.Combo62.RowSource = "Select [Project],[ProSubCat] from [ProjectSubCategories] Where [Project]='" & Me.Combo60 & "'"
Me.Combo62.Requery
End Sub
 
Make sure you include the ; at the end of your Select statement (just before the last quotation marks.

Me.Combo62.RowSource = "Select [Project],[ProSubCat] from [ProjectSubCategories] Where [Project]= '" & Me.Combo60 & "';"
 
Thanks

Thanks for the Help - It's Working Now!!!
 

Users who are viewing this thread

Back
Top Bottom