I have a form to input data to a table. what I am trying to do is: if i enter a duplicate serial number then i want to check another field to make sure the serial number was entered as a different order type.
i.e dropdown list fields are ....new order,repair order,replacement order, etc...
if the serial number i enter exists on the table I need to compare the order type to make sure they are different.??????
below is all i have for the serial number. How would i compare the other field once i run the code below?:banghead:
If DLookup("[Meter Serial Number]", "[table1]", "[meter serial number] = '" & [Forms]![Data Entry]![meter serial number] & "'") > 0 Then
MsgBox "DUPLICATE SERIAL NUMBER" & Chr(13) & " please enter unique serial number or change the order type!", vbExclamation, "DUPLICATE SERIAL NUMBER"
Meter_Serial_Number.SetFocus
MsgNumber = 9
Exit Sub
End If
i.e dropdown list fields are ....new order,repair order,replacement order, etc...
if the serial number i enter exists on the table I need to compare the order type to make sure they are different.??????
below is all i have for the serial number. How would i compare the other field once i run the code below?:banghead:
If DLookup("[Meter Serial Number]", "[table1]", "[meter serial number] = '" & [Forms]![Data Entry]![meter serial number] & "'") > 0 Then
MsgBox "DUPLICATE SERIAL NUMBER" & Chr(13) & " please enter unique serial number or change the order type!", vbExclamation, "DUPLICATE SERIAL NUMBER"
Meter_Serial_Number.SetFocus
MsgNumber = 9
Exit Sub
End If