The OpenForm action was canceled
So i'm working on creating a classic login form. The VBA I wrote did initially work but now suddenly I get this error The OpenForm action was canceled I don't know what happened but if someone could have a look at my VBA and maybe offer some guidance, that would be appreciated. Thank you!
Private Sub btnLogin_Click()
Dim RecSet As Recordset
Set RecSet = CurrentDb.OpenRecordset("tblEmployees", dbOpenSnapshot, dbReadOnly)
RecSet.FindFirst "userName='" & Me.txtUserName & "'"
If RecSet.NoMatch = True Then
Me.lblInvalidUserName.Visible = True
Me.lblInvalidUserName.Visible = False
If RecSet!Password <> Nz(Me.txtPassWord, """") Then
Me.lblInvalidPassword.Visible = True
Me.lblInvalidPassword.Visible = False
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "frmMain"is highlighted yellow and seems to be the problem but I'm confused because it was working previously
Last edited by vent; 05-19-2017 at 09:41 AM.
Reason: pinpoint exact error