I'm new to the whole world of MC Access. I have a database with a subform.
I need to set up the suborm to only allow access to supplies which correspond with the correct supplier (chosen by the user via a Combo box). I have 4 suppliers.
If I use the code below, it works for 1 supplier, but how do I write the code for multiple suppliers. If I add another "WHERE s.Code = "BROWN" " I get both results listed under the supplier. I'm not to sure where to go from here...
SELECT p.PID, p.Code
FROM Supplier AS s INNER JOIN Product AS p ON s.SID = p.SID
ORDER BY p.Code;
Private Sub cboSID_AfterUpdate()
' allow only supplier products to be shown
Dim strCriteria As String
If Eval(Me.cboSID.Value & " IN ( 1, 2, 3 )") = True Then
strCriteria = "SID = " & Me.cboSID.Value
strCriteria = "SID = 4"
' Note: Child_PurchaseOrder is the name of the SubForm control
' the SourceObject property of which is the form frmPurchaseOrderSubForm.
Me.Child_PurchaseOrder.Form.Controls("cboProduct").Value = DLookup("Code", "Product", strCriteria)