I’m trying to use DLookUp to see if a name exists in a database. I’m using the following code:
If Me.LastName = DLookup(“LastName”, “tblStudentNames”) Then
MsgBox “This name already exists in the database.”
End If
It seems to only be looking at the first row in the database and not the other rows. I’m not sure what I’m doing wrong or if I’m doing this correctly.
Thanks,
Leesha