Re: Runtime error calls for macros that are Module subs
- From: "Hunter57" <Pwood57@xxxxxxxxx>
- Date: 25 Jan 2007 15:22:21 -0800
On Jan 25, 10:29 am, Matthias Klaey <m...@xxxxxxxxxxx> wrote:
"Hunter57" <Pwoo...@xxxxxxxxx> wrote:
This is really weird. All of my VBA subs run fine except for from the
VBA Editor Window (they even work in the Immediate Window). But
whenever I try to use the VBA Editor Window to run any sub in ANY
Access DB from in form module or any module I get an error--even with
simple subs like this:
Private Sub myTest(Cancel As Integer)
MsgBox "There is no data for this report. Canceling report..."
End Sub
This is what happens: A Macro Dialog box opens and lists Subs from
Modules are listed in the Macro Dialog box.
It does the same thing in databases that I download.
I am beginning to think I may need to reinstall or repair Access.
Can anybody help?
PatYou need to position the cursor in the Editor Window *within* the Subthat you want to run. If the cursor is in the General Section (before
the first procedure) or at the end (after the last procedure) or
between procedures, the Macro dialog box pops up just as you describe,
since Access cannot know which procedure you want to run.
HTH
Matthias Kläy
--www.kcc.ch- Hide quoted text -- Show quoted text -
Thanks for your tip about not running a Public Sub or Function with
arguments. I appreciate your patience with a newbie.
Pat
.
- References:
- Runtime error calls for macros that are Module subs
- From: Hunter57
- Re: Runtime error calls for macros that are Module subs
- From: Matthias Klaey
- Runtime error calls for macros that are Module subs
- Prev by Date: Re: Emailing a Report
- Next by Date: Re: Emailing a Report
- Previous by thread: Re: Runtime error calls for macros that are Module subs
- Next by thread: Re: Visual Basic Editor question
- Index(es):
Relevant Pages
|
Loading