I am trying to verify that a field (assignment)in a record matches an existing criteria (BREAK-FIX) in an if statement.
I am using a dlookup to take the existing record that is not the primary key and if the criteria matches then continue with the statement and open a form if not then msg box.
heres a sample of the code:
If not IsNull (DLookup "[assignment]", "dbo_problemm1", "[assignment] = '" + "BREAK-FIX" + "'"
) Then
DoCmd.OpenForm "hotswapevent", , , "[number] = '" & Me![number] & "'"
Else
MsgBox "Problem Ticket is not a Break fix, Please enter another Ticket.", 48
Me!number.SetFocus
End If
I am using a dlookup to take the existing record that is not the primary key and if the criteria matches then continue with the statement and open a form if not then msg box.
heres a sample of the code:
If not IsNull (DLookup "[assignment]", "dbo_problemm1", "[assignment] = '" + "BREAK-FIX" + "'"
DoCmd.OpenForm "hotswapevent", , , "[number] = '" & Me![number] & "'"
Else
MsgBox "Problem Ticket is not a Break fix, Please enter another Ticket.", 48
Me!number.SetFocus
End If