Jun 15 2024 03:37 AM
I have a login page and a main page. On my login page, I has this for the code and everything works fine.
Private Sub btn_login_Click()
If DCount("uusername", "usertable", "uusername= '" & txt_username & "' and upassword= '" & txt_password & "'") = 0 Then
Me.lbl_incorrect.Visible = True
Else
DoCmd.Close acForm, "LoginForm"
DoCmd.OpenForm "MainForm"
End If
End Sub
On my main page I have this code when logging out. Some reason when I click yes it just sits there on that form. I don't know what I am missing.
Private Sub btn_logout_Click()
respond = MsgBox("Do you really want to logout?", vbYesNo + vbQuestion, "| Logout Confirmation |")
If response = vbYes Then
DoCmd.Close acForm, "MainForm", acSaveNo
DoCmd.OpenForm "LoginForm"
Else
Cancel = True
End If
End Sub
Jun 15 2024 04:45 AM
SolutionJun 15 2024 04:52 AM
Jun 15 2024 06:15 AM
Option Explicit would prevent that sort of typo.
Jun 15 2024 04:45 AM
Solution