Checking DB to see if match....

G

Guest

Hey Im trying to match something a user has enter to something that’s already
in the database. Here’s what Im trying to do…I want a new user to make up a
username but I want to make sure that the username they made up is not
already taken by a different user already in the database.

Can anyone help with how I can search the database in match the 2 so that
the new user cant pick the same username…


Thank you
 
D

Douglas J. Steele

DLookup is probably the simplest approach.

If IsNull(DLookup("UserName", "UserTable", "UserName = '" & PossibleName
& "'")) Then

' PossibleName doesn't already exist in UserTable

Else

' PossibleName already exists in UserTable

End If
 
G

Guest

Thank you Douglas, that helped a lot....well I going to continue to test it
out to see if it works fully the way I would like it to...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top