Hi,
I have a login form setup in a database that basically uses a table to check for username and password. I would like to be able to use that login information to automatically open a form, that also pulls with it the users login name, and then store the login name to each record the user enters. I am hung up on how to get the login information to transfer over to the form.
Here is the code that controls the login process;
Code:
Option Compare Database
Private Sub cbo_user_AfterUpdate()
Me.txt_Password = Empty
Me.txt_Password.Enabled = True
Me.txt_Password.SetFocus
End Sub
Private Sub cmdOK_Click()
'test the stored password is = to the manually entered password
If Me.cbo_user.Column(2) = Me.txt_Password Then
DoCmd.OpenForm "frmMainMenu", acNormal
DoCmd.Close acForm, "frmLogin"
Else 'wrong match
MsgBox "Wrong password entered." & _
vbCrLf & "Please re-enter password.", _
vbExclamation, "Invalid Password"
Me.txt_Password.SetFocus 'places the cursor in password control
End If
End Sub
All I need is the username. And then I need it to autopopulate a field in a form. Anyone have any ideas? Thanks in advance.