Private Sub txtSealNumber_AfterUpdate() Dim NewTrailer, NewSeal As String Dim stLinkCriteria As String 'Assign the entered Trailer Number and Seal Number to a variable NewTrailer = Me.txtTrailerNumber.Value NewSeal = Me.txtSealNumber.Value stLinkCriteria = ("[TrailerNumber]='" & NewTrailer & "'" And "[SealNumber]='" & NewSeal & "'") If Me.txtTrailerNumber = DLookup("[TrailerNumber]", "Tab_TrailerDetails", stLinkCriteria) Then MsgBox "This trailer, " & NewTrailer & ", has already been entered in database," _ & vbCr & vbCr & "along with seal " & NewSeal & "" _ & vbCr & vbCr & "Please make sure Trailer and Seal are not already entered.", vbInformation, "Duplicate information" 'undo the process and clear all fields Me.Undo End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)