Hello,
I am working an an app developped in VBA/Access, and I would like to
call a macro (named AutoExec) directly from the VBA code of my
program.
I tried the following :
Call AutoExec
in then VBA code, but when compiling, I get an error saying that "Sub
is not defined".
So what is the correct syntax to call a macro from VBA code ?
Thank you for your help.
Jens Schilling - 03 Dec 2007 10:46 GMT
Hi,
> So what is the correct syntax to call a macro from VBA code ?
Try : DoCmd.RunMacro (Macroname)
Regards
Jens
nartla - 03 Dec 2007 10:55 GMT
On 3 déc, 11:46, "Jens Schilling"
<jensschillingBitteLoesc...@fissership.de> wrote:
> Hi,
>
[quoted text clipped - 4 lines]
> Regards
> Jens
Thank you !
DoCmd.RunMacro ("AutoExec")
runs perfectly.
King Ron - 04 Dec 2007 20:24 GMT
..also, you should note that anything that you can do in a Macro you
can do using VBA code...you might want to consider rewriting your
Macro functions in code...
One of the plusses of coding in VBA is that you can hide all of your
DBA-like functions from the steenking users so they can't drive your
app into a tree as easily...
Ron, King of Chi...
lyle - 04 Dec 2007 20:59 GMT
> ..also, you should note that anything that you can do in a Macro you
> can do using VBA code...you might want to consider rewriting your
[quoted text clipped - 5 lines]
>
> Ron, King of Chi...
I have some users but none of them seems to steenk. (A few smell purty
sweet but in these days of political correctness I pretend not to
notice.) They all seem to want my applications to work properly and
help them accomplish things. What am I doing wrong?
bobh - 04 Dec 2007 21:26 GMT
> Hello,
>
[quoted text clipped - 12 lines]
>
> Thank you for your help.
and you also realize that the 'AutoExec' marco gets automatically run
when you run/open your application.
bobh