Hi,
I have a split database with a frontend and backend. There is a bound text box called txtCitationNum linked to a table called NODLog_tbl. I already set the backend to not allow duplicates but I wanted something more user friendly so that when the user's cursor leaves the text box (txtCitationNum) it will search to see if that value already exists in the backend table (NODLog_tbl. If the value does already exist I would like a prompt to let the user know immediately that this value is a duplicate. If it does not exist then I would like it to do nothing. I searched online to see what I could find and someone suggested using the BeforeUpdate event on the control. Here is the code:
If IsNull(DLookup("YourField", "YourTable", "YourField = " & Me.YourField)) Then
Cancel = True
Msgbox "error ......", vbokonly
End If
However I could not get this to work. The code doesn't do anything in the before update or the on lost focus events. Can someone help me with this?
Thanks in advance.