View Full Version : Run Macro


lead 27
08-07-2007, 12:57 PM
Hi

I am wanting help so that I can write a code so that when I select an item from a list box a macro will run the code taht I wrote is

If Me.Stockist = "other" Then
DoCmd.RunMacro (macro1)
End If

But it comes up with
This action or method requires a macro name argument

Any ideas?

RuralGuy
08-07-2007, 01:42 PM
Have you looked up RunMacro in VBA help (not Access help) for an example of the syntax to use?

lead 27
08-07-2007, 01:52 PM
yeah have had a look but cant find any thing.
Maybe its just me.
Will keep looking

lead 27
08-07-2007, 01:56 PM
Have sorted it
It was "macro1" instead of (macro1)

RuralGuy
08-07-2007, 02:01 PM
Great news. I knew you would get it if you looked at the example enough times.

lead 27
08-07-2007, 02:04 PM
Thanks
Obvious now that I look at it LOL

Thanks for your reply