I have an Access 2007 database where I have setup a Lonin form called CreateLogin. The information that is entered into the Create Logon form goes to a table called tblEmployees. I have the following fields in the tblEmployees:
I have a form called "CreateLogin" that lets the user put in their strEmpName, strEmpPassword, and strAccess. The field strAccess will always be admin or user.
I need an If statement to check the table and see if the strAccess is Admin and if so open a form called StartupScreen, if not open a form called "StartUpScreen1.
I have this coding but, I do not know how to make Access know what strAccess is. When I reference strAccess in an If Statement.
My coding is this:
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value
'Close logon form and open splash screen
'If strAccess = "admin" Then
DoCmd.Close acForm, "frmLogon", acSaveNo
How can I fix this. When I Dim strAccess as String, access stsill does not know what strAcess is
Do you have some sample coding in VBA that will do what I want to do here.