I have an Access Form with two combo boxes, PO Number and Vendor Number. The Vendor Number will automatically filter to show only those who match the chosen PO Number (PO Numbers are sadly not unique; multiple unrelated vendors may have 2180965 as their PO Number, for example).
Some POs are exempt from our inspection process, and we keep a list of them in a table called ZeroAudit. That table contains both the PO Number and Vendor Number for the exempt delivery.
Before I found out that PO Numbers weren't unique, I was using this code to tell our team whether a given PO requires inspection. How can I update it to require that both the PO Number and Vendor Number match the ZeroAudit table entry to be exempt from QA?
Private Sub VendorNumber_AfterUpdate()
Dim IntX As Integer
IntX = DCount("*", "ZeroAudit", "PONumber=" & Chr(34) & Me.PONumber.Value & Chr(34))
Debug.Print Me.PONumber.Value
If IntX = 0 Then
MsgBox "Needs QA"
Me.PONumber.SetFocus
ElseIf IntX > 0 Then
MsgBox "Does NOT Need QA — DIM and RETAIL CHECK REQUIRED"
Me.PONumber.SetFocus
End If
End Sub