SteveL13
asked on
Warning if name already exists in database
I'm trying to alert a user if a name already exists in the database. Something is wrong with this code. Can someone tell me what it is? The syntax is wrong in the first line.
If DCount("*", "Member Table", "MemberFullName = '" & Me.txtMemberFullName & "') > 0 then
MsgBox "There is already a member in the database with this name.", vbOKOnly
End If
If DCount("*", "Member Table", "MemberFullName = '" & Me.txtMemberFullName & "') > 0 then
MsgBox "There is already a member in the database with this name.", vbOKOnly
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Never mind. It IS working. Thanks. I do have another question closely related but I'll post another topic.
ASKER
If DCount("*", "Member Table", "MemberFirstName = '" & Me.txtMemberFirstName & "' AND MemberLastName = '" & Me.txtMemberLastName & "'") > 0 Then
MsgBox "There is already a member in the database with this name.", vbOKOnly
End If