I have a switch board to allow login for a few users plus admin user - screenshot attached.
I had the admin log in working or so I thought (well I was pleased with my first bit of VBA that worked then oh dissapointment when I found that no entry or blank would allow the main form to open
my original code
Private Sub btn_adminlogin_Click()
Dim strWhere As String
If txt_admin_pass <> "password" Then
MsgBox "Incorrect Password"
Else
DoCmd.OpenForm "Incident Form" ' ac Normal
End If
End Sub
then I tried something else but I've been playing with this for far too long now
Private Sub btn_adminlogin_Click()
If Me.txt_admin_pass Is Null Then
MsgBox "Please Enter Password"
Me.txt_admin_pass.SetFocus
Else
If txt_admin_pass <> "password" Then
MsgBox "Incorrect Password"
Else
DoCmd.OpenForm "Incident Form" ' ac Normal
End If
End Sub
As for the top row (of screenshot), (I have a table tbl_depot which has field [depot] source for the combo box and [passcode]) the unbound box txt_dpt_pass I was hoping to open via a query only those matching the depot but I,m stumped on both
I had the admin log in working or so I thought (well I was pleased with my first bit of VBA that worked then oh dissapointment when I found that no entry or blank would allow the main form to open
my original code
Private Sub btn_adminlogin_Click()
Dim strWhere As String
If txt_admin_pass <> "password" Then
MsgBox "Incorrect Password"
Else
DoCmd.OpenForm "Incident Form" ' ac Normal
End If
End Sub
then I tried something else but I've been playing with this for far too long now
Private Sub btn_adminlogin_Click()
If Me.txt_admin_pass Is Null Then
MsgBox "Please Enter Password"
Me.txt_admin_pass.SetFocus
Else
If txt_admin_pass <> "password" Then
MsgBox "Incorrect Password"
Else
DoCmd.OpenForm "Incident Form" ' ac Normal
End If
End Sub
As for the top row (of screenshot), (I have a table tbl_depot which has field [depot] source for the combo box and [passcode]) the unbound box txt_dpt_pass I was hoping to open via a query only those matching the depot but I,m stumped on both
Attachments
Last edited: