Having not done any real programming since college almost 6 years ago I'm slowly picking it back up as I build a new database so my knowledge is still pretty limited to what I remember.
Currently I have a form that is password protected by another form.
Design goes as this:
Main Menu>Open Password_Form>Open Inventory_Form
Code is:
Dim PassWord As String
Private Sub Password_OK_Click()
' verify password then close password form and open inventory form
PassWord = Password_Text
If PassWord = "mypassword" Then
DoCmd.Close
DoCmd.OpenForm "Inventory"
' reset password text to blank and throw dialog box
Else
MsgBox ("You're not auathorized for Administrator access.")
Password_Text = ""
End If
End Sub
Since then I have tried the following but getting an invalid use of Null when left blank:
~
Dim PassWord As String
Private Sub Password_OK_Click()
PassWord = Password_Text
' Close password form and open inventory form
If PassWord = "amledpass" Then
DoCmd.Close
DoCmd.OpenForm "Inventory"
' Password left blank throw dialog box
ElseIf PassWord = Empty Then
MsgBox ("Please enter password.")
Exit Sub
' Reset password text to blank and throw dialog box
Else
MsgBox ("You're not auathorized for Administrator access.")
PassWord = ""
End If
End Sub