Hi All
I have developed a login form for one of the database to control the access of users who can use the database. and this is what i am using to check the UserName and Password.
Set Curdb = CurrentDb() 'If your table and form are in same database other wise change it
SQLStmt = "SELECT * FROM [tblSecurity] WHERE [UserName] = '" & Trim("" & Me![txtUserName]) & "'"
SQLStmt = SQLStmt & " AND [Password] = '" & Trim("" & Me![txtPassword]) & "'"
Set SecTB = Curdb.OpenRecordset(SQLStmt, DB_OPEN_DYNASET)
If SecTB.EOF Then
MsgBox "Logon ID or Password not found!", 16, "Incorrect Logon Information"
SecTB.Close
Exit Sub
End If
SecTB.Close
DoCmd.OpenForm "frmSearch"
DoCmd.Close A_FORM, "frmLogIn"
Forms![frmSearch].SetFocus
i have developed two type of same forms one is a read only form and other one is a full access form where the user can add, delete, update information.
i want the forms to open based on what group they belong to
Eg. Username Password Group
David dav12 Read Only
Alex al60 Admin (Full Access)
if David logs in then it should open frmROSearch, (RO = Read Only) and if Alex logs in then should open frmSearch
so what do i need to do to direct the user to particular form based on what group they belong to.
Thanks Heaps
R
I have developed a login form for one of the database to control the access of users who can use the database. and this is what i am using to check the UserName and Password.
Set Curdb = CurrentDb() 'If your table and form are in same database other wise change it
SQLStmt = "SELECT * FROM [tblSecurity] WHERE [UserName] = '" & Trim("" & Me![txtUserName]) & "'"
SQLStmt = SQLStmt & " AND [Password] = '" & Trim("" & Me![txtPassword]) & "'"
Set SecTB = Curdb.OpenRecordset(SQLStmt, DB_OPEN_DYNASET)
If SecTB.EOF Then
MsgBox "Logon ID or Password not found!", 16, "Incorrect Logon Information"
SecTB.Close
Exit Sub
End If
SecTB.Close
DoCmd.OpenForm "frmSearch"
DoCmd.Close A_FORM, "frmLogIn"
Forms![frmSearch].SetFocus
i have developed two type of same forms one is a read only form and other one is a full access form where the user can add, delete, update information.
i want the forms to open based on what group they belong to
Eg. Username Password Group
David dav12 Read Only
Alex al60 Admin (Full Access)
if David logs in then it should open frmROSearch, (RO = Read Only) and if Alex logs in then should open frmSearch
so what do i need to do to direct the user to particular form based on what group they belong to.
Thanks Heaps
R