Expand|Select|Wrap|Line Numbers
- Private Sub BusinessName_AfterUpdate()
- Dim NewBusinessName As String
- Dim stlinkcriteria As String
- NewBusinessName = Me.BusinessName.Value
- stlinkcriteria = "[BusinessName] = " & "'" & NewBusinessName & "'"
- If Me.BusinessName = DLookup("[BusinessName]", "Sheet1", stlinkcriteria) Then
- MsgBox "" & NewBusinessName & " is already in the Database." _
- & vbCr & vbCr & "Data Entry Denied!!!", vbInformation, "DUPLICATE ENTRY"
- Me.Undo 'undo the process and clear all fields
Do you have any suggestions to correct the error?