B
Ben
Hi group -
I came across something that seems unusual today, and I'm
hoping somone can clarify what is going on 'behind the
scenes'.
In Access97 I have a custom menubar for a form, the menu
options call a macro that calls a function on the form.
(Normally I use VB6 or .NET so this whole process was
rather frustrating) In the macro I had a RunCode action
and the function Forms!myForm.myFunction. This worked
just fine, bit noticed that the function was being called
3 times, and yet is was only on the stack 1 time !?! This
didn't hurt anything, but it annoyed me. I started
looking around and Access help says that if the macro is
called from a menubar for a form Access searches for the
function in the form's code module 1st. So, I tried de-
qualifying the reference to just myFunction - start over
and the code only runs once.
What's going on here? Does Access work backwards along
the function name arguement so with Forms!
myForm.myFunction RunCode found it 3x? Even more spooky,
I'd coded the functions with no return value or type
since Access ignores it in this context, when at first I
just added myFunction() as Integer the code only ran
twice.
Am I crazy or does this all seem a little strange.
TIA for any input.
Thanks
Ben
I came across something that seems unusual today, and I'm
hoping somone can clarify what is going on 'behind the
scenes'.
In Access97 I have a custom menubar for a form, the menu
options call a macro that calls a function on the form.
(Normally I use VB6 or .NET so this whole process was
rather frustrating) In the macro I had a RunCode action
and the function Forms!myForm.myFunction. This worked
just fine, bit noticed that the function was being called
3 times, and yet is was only on the stack 1 time !?! This
didn't hurt anything, but it annoyed me. I started
looking around and Access help says that if the macro is
called from a menubar for a form Access searches for the
function in the form's code module 1st. So, I tried de-
qualifying the reference to just myFunction - start over
and the code only runs once.
What's going on here? Does Access work backwards along
the function name arguement so with Forms!
myForm.myFunction RunCode found it 3x? Even more spooky,
I'd coded the functions with no return value or type
since Access ignores it in this context, when at first I
just added myFunction() as Integer the code only ran
twice.
Am I crazy or does this all seem a little strange.
TIA for any input.
Thanks
Ben