Hi,
i used below code to close a for if no record
I get a run time error 2585, This action can't be carried out while processing a form...
any reason why?
Code Tags Added by UG
Please use Code Tags when posting VBA Code
Please feel free to Remove this Comment
https://www.access-programmers.co.u...e-use-code-tags-when-posting-vba-code.240420/
i used below code to close a for if no record
I get a run time error 2585, This action can't be carried out while processing a form...
any reason why?
Code Tags Added by UG
Please use Code Tags when posting VBA Code
Please feel free to Remove this Comment
https://www.access-programmers.co.u...e-use-code-tags-when-posting-vba-code.240420/
Code:
Private Sub Form_Current()
If Me.Recordset.RecordCount = 0 Then
DoCmd.Close acForm, "admin", asSaveYes
MsgBox "You do not have access to Admin", vbOKOnly, "Admin / Setup"
End If
End Sub
Last edited by a moderator: