Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a login form with passwords for an access database

Status
Not open for further replies.

TriggerKG

Technical User
Oct 13, 2003
1
IE
I have created a form with 2 txt boxes txtlogin and txtpassword and also i have a login command button on the form. I have run a query on my database called qryemployee which has results for EmployeeID and Password.

I have set this frmlogin to open first. when i click the command button it opens my database. what i want is to add code to the following so it checks my query to see if the employeeID is the same as what was entered in the txtlogin and check that the corresponding password is the valid. and if so go ahead and open database. if not clear txtlogin and txtpassword and get user to reenter details.

Code:

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

Dim stDocName As String

stDocName = "mcrLogin"
DoCmd.RunMacro stDocName

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top