G
Guest
I have a DblClick event procedure that has an OpenForm method call:
DoCmd.OpenForm "fmTickets", acNormal, , "RemTkt = " & ticketID,
acFormEdit, acWindowNormal
If all goes well the Cancel argument of the Event Procedure is set to False.
If not, control transfers to an error handling block and sets Cancel to True.
There is an Exit Sub before the error handler, so execution isn't dropping
through. The debugger shows control skipping into the error handler.
As soon as I hit this statement, an error/exception is raised which causes
an "OpenForm cancelled" message (Access Error 2501) to be issued. I have read
all of the online documentation I can find and can come up with no reason for
this happening. (Although that may be the result of tunnel vision by this
point in time.)
My question is not so much "Why is this happening?" as "How does one debug
this?" Single stepping through the code tells me nothing; as soon as the
statement is executed, control transfers to my error handler and issues the
message. (without the error handler, nothing at all appears! The form never
shows up, but there is also no popup!) But I have no way of getting 'inside'
the execution to find out why the cancel occurs. I'm sure this is not the
only example of where someplace inside a method call an exception is raised
and nothing obvious is revealed to the programmer. How do the experts deal
with these?
Trolling for knowledge. TIA.
DoCmd.OpenForm "fmTickets", acNormal, , "RemTkt = " & ticketID,
acFormEdit, acWindowNormal
If all goes well the Cancel argument of the Event Procedure is set to False.
If not, control transfers to an error handling block and sets Cancel to True.
There is an Exit Sub before the error handler, so execution isn't dropping
through. The debugger shows control skipping into the error handler.
As soon as I hit this statement, an error/exception is raised which causes
an "OpenForm cancelled" message (Access Error 2501) to be issued. I have read
all of the online documentation I can find and can come up with no reason for
this happening. (Although that may be the result of tunnel vision by this
point in time.)
My question is not so much "Why is this happening?" as "How does one debug
this?" Single stepping through the code tells me nothing; as soon as the
statement is executed, control transfers to my error handler and issues the
message. (without the error handler, nothing at all appears! The form never
shows up, but there is also no popup!) But I have no way of getting 'inside'
the execution to find out why the cancel occurs. I'm sure this is not the
only example of where someplace inside a method call an exception is raised
and nothing obvious is revealed to the programmer. How do the experts deal
with these?
Trolling for knowledge. TIA.