Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I believe [blue]jrbarnett[/blue] has posted your solution, however I'm curious as to just what your validation is looking for? . . .andzejek said:[blue] . . . "on the fly" validation . . .[/blue]
[blue] Dim Msg As String, Style As Integer, Title As String
Dim Criteria As String, DL As String
DL = vbNewLine & vbNewLine
Criteria = "[[purple][b][i]FieldName[/i][/b][/purple]] = [red][b]'[/b][/red]" & Me![purple][b][i]ControlName[/i][/b][/purple] & "[red][b]'[/b][/red]"
If Not IsNull(DLookup("[[purple][b][i]FieldName[/i][/b][/purple]]", "[purple][b][i]TableName[/i][/b][/purple]", Criteria)) Then
Msg = "Duplicate Data Entry Detected!" & DL & _
"Duplicates for this field are not allowed!" & DL & _
"Modify your data entry or hit 'Esc' to abort the record! . . ."
Style = vbInformation + vbOKOnly
Title = "Duplicate Error Detected! . . ."
MsgBox Msg, Style, Title
[b]Cancel = True[/b]
End If[/blue]
[blue] Me.First_Name.Enabled = True
Me.First_Name.SetFocus
Me.CUST.Enabled = False[/blue]