For the combo box, the events are just the AfterUpdate and OnChange
Code:
Private Sub cboProducts_AfterUpdate()Dim strFilter As String
DoCmd.OpenQuery "TempCustomerPriceCheck2"
strFilter = "ProductID=" & Me!cboProducts
Me!price = DLookup("price", "Temppricecheck", strFilter)
Me!units = DLookup("unitsID", "temppricecheck", strFilter)
Me.CustID = Forms!frmOrderPlacement!txtcustID
Me.txtqty.SetFocus
End Sub
Private Sub cboProducts_Change()
cboProducts.RowSource = "SELECT DISTINCTROW tblPrices.productID, products.Item, tblPrices.price, tblinventory.Sumofqty, tblPrices.CustID, tblPrices.available" & _
" FROM ((products INNER JOIN tblPrices ON products.productID = tblPrices.productID) INNER JOIN tblUnits ON products.unitsID = tblUnits.unitsID) LEFT JOIN tblinventory ON tblPrices.productID = tblinventory.productID" & _
" WHERE products.Item Like '*' & [cboProducts].text & '*' AND tblPrices.CustID=Forms!frmOrderPlacement!txtcustID AND tblPrices.available=False" & _
" ORDER BY products.Item"
End Sub
This allows standard products to use 'custom' pricing for the current customer.
I have tried in the
Code:
Private Sub cboProducts_NotInList(NewData As String, Response As Integer)DoCmd.SetWarnings False
End Sub
but this does not work and the alert still pops up, the filtering works fine for the next product, I just need to stop this message box appearing now?