F
faz
hello
i want that a form close itself when the user press a commandbutton, and
before that
some controls has to be executed. The problem is that vba shows no errors
but
the form can't close itself unless user press X in the top-right corner
here my simple code
------------------------------------------------
Option Compare Database
Private Sub cmdok_Click()
On Error GoTo Err_handler
Form_Unload (False)
exit sub
Err_handler:
Debug.Print "Errore:"; Err.Description; Err.Number
End Sub
Private Sub check_routine1()
Debug.Print "dentro check_routine"
End Sub
Private Sub Form_Unload(Cancel As Integer)
check_routine1
end sub
-----------------------------------------------------
if i switch form_unload with form_close event nothing changes, and if i add
a docmd.close command at the end of the event handler an error will raise
Thanks for any help
i want that a form close itself when the user press a commandbutton, and
before that
some controls has to be executed. The problem is that vba shows no errors
but
the form can't close itself unless user press X in the top-right corner
here my simple code
------------------------------------------------
Option Compare Database
Private Sub cmdok_Click()
On Error GoTo Err_handler
Form_Unload (False)
exit sub
Err_handler:
Debug.Print "Errore:"; Err.Description; Err.Number
End Sub
Private Sub check_routine1()
Debug.Print "dentro check_routine"
End Sub
Private Sub Form_Unload(Cancel As Integer)
check_routine1
end sub
-----------------------------------------------------
if i switch form_unload with form_close event nothing changes, and if i add
a docmd.close command at the end of the event handler an error will raise
Thanks for any help