Run a "macro" in a module

J

Jeff

Hi,

I wrote some code in "Module1" in the Modules tab in access.
Here is what I wrote

Option Compare Database

Sub SetOff()
DoCmd.SetWarnings = False
End Sub

This just sets the warnings off.

My question is - how do I run this from the "Macros" tab.

I tried "OpenModule" and then set the procedure = "SetOff"

But this did not work.

Thanks for your help!
 
D

Douglas J. Steele

Macros can only run functions, not subs.

Change it to

Function SetOff()
DoCmd.SetWarnings = False
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top