2.27 Creating a Multi User Login System in Access VBACreating a multi-user login form to password protect different areas of your database Here's the code: Username.SetFocus If Username = "staff1" And Password = "staff1" Then MsgBox "Access Granted", vbInformation, "CD Shop" MsgBox "Welcome", vbInformation, "CD Shop" DoCmd.Close DoCmd.OpenForm "F_Switchboard" ElseIf Username = "staff2" and Password = "staff2" Then MsgBox "Access Granted", vbinformation, "CD Shop" MsgBox "Welcome", vbinformation, "CD Shop" DoCmd.Close DoCmd.OPenForm "F_Switchboard" ElseIf Username = "manager1" and Password = "manager1" Then MsgBox "Welcome, Manager", vbinformation, "Manager Area" MsgBox "Please Exercise Caution When Altering Back End", vbinformation, "Manager Area" DoCmd.Close DoCmd.OPenForm "F_Switchboard_Manager" Else MsgBox "Please re-enter your Username and Password." End If code pour embarquer la vidéo : >>> http://www.youtube.com/embed/UO4HeWnuT3A <<< |