PC Review


Reply
Thread Tools Rate Thread

Access Form: Click Event Does not Fire?

 
 
Smartin
Guest
Posts: n/a
 
      7th Nov 2007
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.

 
Reply With Quote
 
 
 
 
UpRider
Guest
Posts: n/a
 
      7th Nov 2007
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

"Smartin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Tom van Stiphout
Guest
Posts: n/a
 
      7th Nov 2007
On Tue, 6 Nov 2007 19:54:40 -0700, "UpRider" <(E-Mail Removed)>
wrote:

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.


>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
>
>"Smartin" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> 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.
>>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to click twice to fire an Event Goldenrate Microsoft Dot NET 8 21st May 2009 12:55 PM
Need to click twice to fire an Event Goldenrate Microsoft Dot NET 0 14th May 2009 03:21 AM
Fire Button click event from another form in 2005 Rick Microsoft C# .NET 4 6th Aug 2008 05:51 PM
Re: ToolStripButton does not fire click event if form does not have focus? Lloyd Sheen Microsoft VB .NET 0 28th Apr 2008 11:27 PM
fire a click event from another form =?Utf-8?B?ZXZlcmVhZHk=?= Microsoft VB .NET 2 23rd Apr 2004 04:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:32 PM.