dbTalk Databases Forums  

Button event firing twice when using =Event

comp.database.ms-access comp.database.ms-access


Discuss Button event firing twice when using =Event in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrew Backer
 
Posts: n/a

Default Button event firing twice when using =Event - 05-25-2004 , 11:30 PM






Having an odd little problem with one of my forms.

I have a button on my form, which is in 'repeating form' mode. When I
use an event procedure for the 'onclick' it fires once. If I use the
syntax "=SomeFunc()" it fires twice.

Created another test form and did the same thing, but it fires once and
then crashes with the standard 'error in macro or something else' message.

Any clues?

- Andrew Backer

Reply With Quote
  #2  
Old   
Andrew Backer
 
Posts: n/a

Default Re: Button event firing twice when using =Event - 05-25-2004 , 11:34 PM







Fixed it! I should post more often; every time I do I find that I
figure out what the problem is.

I had declared the routine as a 'sub'. I change it to 'function' and
everything works fine.

Now I can put "=MyFunc([MyId]) on my button w/ no worries.

Kinda irritating, but I suppose there must be some reason. Maybe the
caller expectes some sort of return value, even though I don't return
anything from the function.

Andrew Backer wrote:

Quote:
Having an odd little problem with one of my forms.

I have a button on my form, which is in 'repeating form' mode. When I
use an event procedure for the 'onclick' it fires once. If I use the
syntax "=SomeFunc()" it fires twice.

Created another test form and did the same thing, but it fires once and
then crashes with the standard 'error in macro or something else' message.

Any clues?

- Andrew Backer

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.