Access Form: Click Event Does not Fire?

S

Smartin

Greetings All,

Using A2003, WinXPPro environment. I have a form with three buttons.
The form has click event code for each button. Two of the buttons work
fine. Click event code runs as prescribed.

The third button does not work, and I can't find any reason why. By
"does not work" I mean nothing seems to happen when the button is
clicked. However, if I place a breakpoint on the first line of code
for this this button, execution is stopped on the breakpoint. Resuming
execution processes the remaining code as expected.

So why does the third button click event not fire unless a breakpoint
is set?

FWIW this MDB is compacted/repaired automatically every time it closes.
 
U

UpRider

Try adding the command DoEvents at the beginning of the on click event code.
It sounds like some kind of timing problem. DoEvents can sometimes overcome
that.

UpRider
 
T

Tom van Stiphout

However DoEvents also makes code reentrant, and clicking the button
several times may cause several stack frames to be executing at the
same time. Hardly ever what the innocent developer intended.

I would like to ask the OP to debug this by commenting out all code in
the click event, replacing it with a single Hello World messagebox. If
that works, the problem is with the code itself, and he/she should
post it so we can comment on it.

-Tom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top