I'm getting a 2501 Open Form action cancelled error when I click the login button on my login form. On selecting debug the highlighted code is:
The Navigation form has an On Open event which calls a tempvars macro:
When I comment this code out the form opens as expected without an error, so this is where I started investigating.
I've confirmed all the controls in the above code are still valid and spelled correctly. I've copied and pasted last known working code from a backup and I've also deleted and recreated the tempvar but I still get the 2501 error.
All was fine before I made some formatting changes to my forms today. No controls have been renamed and no code has been touched so I'm at a loss.
I am resigned to going back to an earlier front end backup but, before I do, if someone could somehow point me in the right direction on what I can do about this I would be grateful.
Code:
DoCmd.OpenForm "Navigation Form"
The Navigation form has an On Open event which calls a tempvars macro:
Code:
Private Sub Form_Open(Cancel As Integer)
If TempVars!CurrentLevel = "Admin" Then
'ShortcutMenu = True
btnNewUser.Visible = True
UUbtn.Visible = True
UDbtn.Visible = True
Else
'ShortcutMenu = False
btnNewUser.Visible = False
UUbtn.Visible = False
UDbtn.Visible = False
End If
End Sub
When I comment this code out the form opens as expected without an error, so this is where I started investigating.
I've confirmed all the controls in the above code are still valid and spelled correctly. I've copied and pasted last known working code from a backup and I've also deleted and recreated the tempvar but I still get the 2501 error.
All was fine before I made some formatting changes to my forms today. No controls have been renamed and no code has been touched so I'm at a loss.
I am resigned to going back to an earlier front end backup but, before I do, if someone could somehow point me in the right direction on what I can do about this I would be grateful.