log in form.

P

Playboy

I want to make a simple log in form for a non sensitive database
I have a form, when I press the command button "Log in" on the form,
want the data entered in the username: and password: text boxes to be
verifyed with the username and password fields in the Users table.
anyone know how to do this? the command button has no validate property
as i discovered...
 
L

Larry Linson

Unbound Controls and some very simple VBA code employing the DLookup domain
aggregate function would be the easiest way.

Something like:

If Not IsNull(DLookup ("UserName","tblUser","[UserName] = """&
Me!txtLogInName & """")) Then
If Me!txtLogInPW = DLookup("UserPass","tblUser",","[UserName] = """&
Me!txtLogInName & """") Then
... it is OK, user is authorized
Else
... invalid password, take appropriate action
Else
... invalid user ID, take appropriate action
End If

Appropriate action might be to give them three tries and then Close the
LogIn form, for example, so someone can't just sit there and try all day to
guess a valid userid and password.

Larry Linson
Microsoft Access MVP
 

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

Top