Basic Login Script

.Justin

Registered User.
Local time
Today, 23:42
Joined
Jun 29, 2009
Messages
38
Hi All, Happy New Year!

I am running the following code on a simple A Level coursework Database.

Code:
If IsNull(Me.quserid) Then
MsgBox "You must enter your username."
Exit Sub
Else
If IsNull(Me.qpassword) Then
MsgBox "You must enter you password."
Exit Sub
End If

If Me.qpassword.Value = DLookup("Password", "User Details", "Username = '" & Me.quserid.Value & "'") Then
DoCmd.Close
MsgBox "Thank You For Logging In"
DoCmd.OpenForm "FRM_Main_Menu_Live", acNormal

This all works fine :D However what I would like to know is it possible to copy what the user types as their Login name and show this on the menu screen so it shows something like Welcome, Justin. So the name is what the user logs in with?

Thanks

Justin
 
Justin,

It should be just a case of adjusting the form caption or if using a label the label caption

So after opening the form you would use something like this in the Frm_Main_Menu On Open Event

DoCmd.OpenForm "FRM_Main_Menu_Live", acNormal

Private Sub Form_Open(Cancel As Integer)
Me.Caption = "Welcome" & frmName.TextBox.Value

End Sub
 

Users who are viewing this thread

Back
Top Bottom