B
Bob
The code listed informs me that another telephone exist.
What additional code is necessary to clear the field and
begin reentering another telepnone nember after
selecting "ok" when the error appears?
Private Sub Telephone_BeforeUpdate(Cancel As Integer)
Dim x As Variant
x = DLookup("[Telephone]", "Realtor List", "[Telephone]
= '" _
& Forms!RealtorList!Telephone & "'")
On Error GoTo realid_err
If Not IsNull(x) Then
Beep
MsgBox "Duplicate TELEPHONE Entry",
vbOKOnly, "DUPIPLICATE VALUE"
Cancel = True
End If
realid_exit:
Exit Sub
realid_err:
MsgBox Error$
Resume realid_exit
End Sub
What additional code is necessary to clear the field and
begin reentering another telepnone nember after
selecting "ok" when the error appears?
Private Sub Telephone_BeforeUpdate(Cancel As Integer)
Dim x As Variant
x = DLookup("[Telephone]", "Realtor List", "[Telephone]
= '" _
& Forms!RealtorList!Telephone & "'")
On Error GoTo realid_err
If Not IsNull(x) Then
Beep
MsgBox "Duplicate TELEPHONE Entry",
vbOKOnly, "DUPIPLICATE VALUE"
Cancel = True
End If
realid_exit:
Exit Sub
realid_err:
MsgBox Error$
Resume realid_exit
End Sub