-
Cascading ComboBoxes
Hi, I'm not a programmer and I've been having an awful time trying to figure out the errors.
I'm just trying to get combobox2 to change according to combobox1 and combobox3 to change according to combobox 1 and 2, etc. for 5 comboboxes.
I've been experimenting and I got as far as the code posted below targeting combobox3. My problem is I get an error if I don't comment out the Me.ComboBox3.RowSource = strSQL and Me.ComboBox3.Requery.
Please give me a solution!! Thank you
[VBA]Private Sub ComboBox2_AfterUpdate()
Dim upBrand As String
Dim upCategory As String
Dim strSQL As String
strSQL = Me.ComboBox3.Value
upBrand = Me.ComboBox1.Value
upCategory = Me.ComboBox2.Value
strSQL = "SELECT [Price] " & "FROM tblCombinedData" & "WHERE tblCombinedData.Brand= '" & upBrand & upCategory & " " & _
"ORDER BY tblCombinedData.Price;"
Me.ComboBox3.RowSource = strSQL
Me.ComboBox3.Requery
End Sub[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules