VB Login help

jserrone

New member
Local time
Today, 13:32
Joined
Jul 6, 2007
Messages
8
Hello,

I have the attached database with a logon screen. I would like to be able to open a separate form for anyone logging in as an Admin. Bellow is the following VB code used to open the WelcomeForm once they authenticate the logon. Is there a possibility to add that anyone accessing with Admin only would have access to the form XXXX

Thanks

'Check value of password in tblEmployees to see if this matches value chosen in combo box
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then

lngEmpID = Me.cboEmployee.Value

'Close logon form and open splash screen

DoCmd.OpenForm "WelcomeForm"
DoCmd.Close acForm, "frmLogon", acSaveNo
 

Attachments

VB Login Help

You could simply carry out a select case statement

Select Case Me.cboEmployee.Value
Case "Admin"
DoCmd.OpenForm "XXX"
Case "Else
DoCmd.OpenForm "WelcomeForm"
End Select
 

Users who are viewing this thread

Back
Top Bottom