title: Microsoft Access Login System & Admin User Level Security
body: <p>before you ask i have spents weeks googling this to no avail. I am currently designing a database system for a business in Microsoft Access 2007. The system works fine but theres some things i need help with to fix.</p>
  
  <p>Currently, i have 2 forms;</p>
  
  <p>Login_FRM - A form which is a login screen. The code for this box at the moment is </p>
  
  <pre><code>If IsNull(Me.Username) Or Me.Username = "" Then
          MsgBox "You must enter the username of an active employee.", vbOKOnly, "Required Data"
              Me.Username.SetFocus
          Exit Sub
      End If
  
  If IsNull(Me.PasswordLookup) Or Me.PasswordLookup = "" Then
          MsgBox "You must provide a password.", vbOKOnly, "Required Data"
              Me.PasswordLookup.SetFocus
          Exit Sub
      End If
  
  
      Me.PasswordLookup.Value = DLookup("[Password]", "User_TBL", "[Username] ='" &amp; Me.Username &amp; "'")
  
      If Me.PasswordLookup.Value = Me.PasswordLookup.Value Then
  
      DoCmd.OpenForm "MainMenu_FRM"
  
      Else
              MsgBox "Incorrect Username or Password. Please try again.", vbOKOnly, "Please try again"
          Me.PasswordLookup.SetFocus
          Exit Sub
      End If    
  End Sub
  </code></pre>
  
  <p>This checks if null etc, but also checks against fields stored in the User_TBL to see if the user can gain access. </p>
  
  <p>I also have MainMenu_FRM, which is a main springboard for all the processes of the database. </p>
  
  <p>Basically what i want to do is to ONLY allow a user access to an Admin menu, if there are registered as Admin in the User_TBL (Yes/No)</p>
  
  <p>I would be very greatful for any help that anyone has.</p>
  
  <p>Thanks</p>
  
  <p>Here is a quick outline of the whole process</p>
  
  <ol>
  <li><p>User /who is not admin/ is displayed with login screen.</p></li>
  <li><p>User enters details and clicks login, gained access to main menu.</p></li>
  <li><p>Clicks admin button on main menu. Is denied access.</p></li>
  </ol>