M
Michel S.
Hi !
Sorry if this seems a pre-newbie question, but this one is puzzling me
(maybe because the lack of sleep ?).
I have a form with the following code in its Open event :
Private Sub Form_Open(Cancel As Integer)
If IsOkToProceed = False Then
MsgBox "Can't use this form now - Open canceled"
Cancel = True
End If
End Sub
The IsOkToProceed return false (I added the MsgBox to verify it) and
cancel is set to true.
Despite this, the form's code execution continues with the "Load"
event, etc.. until it fails at the end of the "Current" event, with
the message "Error 2001 - Error set by application or object" (BTW,
isn't it supposed to be "Error 2001 - You canceled the previous
operation" ?).
The problem is that the load and current events perform operations I
don't want to do if the form can't be used.
Is this the way it is supposed to be ?
Don't a canceled open immediately returns to the line where the open
command was given ?
Thanks
PS: I'm using Access 2002
Sorry if this seems a pre-newbie question, but this one is puzzling me
(maybe because the lack of sleep ?).
I have a form with the following code in its Open event :
Private Sub Form_Open(Cancel As Integer)
If IsOkToProceed = False Then
MsgBox "Can't use this form now - Open canceled"
Cancel = True
End If
End Sub
The IsOkToProceed return false (I added the MsgBox to verify it) and
cancel is set to true.
Despite this, the form's code execution continues with the "Load"
event, etc.. until it fails at the end of the "Current" event, with
the message "Error 2001 - Error set by application or object" (BTW,
isn't it supposed to be "Error 2001 - You canceled the previous
operation" ?).
The problem is that the load and current events perform operations I
don't want to do if the form can't be used.
Is this the way it is supposed to be ?
Don't a canceled open immediately returns to the line where the open
command was given ?
Thanks
PS: I'm using Access 2002