Hello,
Combo 2 within a subform lists Products available to purchase upon the selection of a Supplier in Combo 1 within a main form.
Upon completing the first product to purchase, I try to select another product to purchase with the same supplier in the second line, but it automatically selects the first product.
Here is the row source for Combo 1:
Private Sub SupplierID_AfterUpdate()
Dim sSQL As String
'Build the SQL query statement
sSQL = "SELECT ProductID, ProductName" & _
" FROM Products" & _
" WHERE SupplierID = " & Me.SupplierID.Value & ";"
'Set the row source property of combo ProductID
Me.Purchase_Orders_Subform!ProductID.RowSource = sSQL
'Refresh the form data
Me.Purchase_Orders_Subform!ProductID.Requery
End Sub
I think I also need to add a row source property for Combo 2. Would I use the exact same row source as Combo 1?
Thanks. New to VB Programming
Combo 2 within a subform lists Products available to purchase upon the selection of a Supplier in Combo 1 within a main form.
Upon completing the first product to purchase, I try to select another product to purchase with the same supplier in the second line, but it automatically selects the first product.
Here is the row source for Combo 1:
Private Sub SupplierID_AfterUpdate()
Dim sSQL As String
'Build the SQL query statement
sSQL = "SELECT ProductID, ProductName" & _
" FROM Products" & _
" WHERE SupplierID = " & Me.SupplierID.Value & ";"
'Set the row source property of combo ProductID
Me.Purchase_Orders_Subform!ProductID.RowSource = sSQL
'Refresh the form data
Me.Purchase_Orders_Subform!ProductID.Requery
End Sub
I think I also need to add a row source property for Combo 2. Would I use the exact same row source as Combo 1?
Thanks. New to VB Programming