How to run a module?

  • Thread starter Thread starter hanski
  • Start date Start date
H

hanski

Hi.

I have in my Form a code:

DoCmd.OpenModule "Module2", "First"


and I have a module called Module2 and in it:

Sub First()
MsgBox ("Hi!")
End Sub

My code in a Form do not execute the First, it only opens it.

How can I get it be executted immediately without opening it?

hanski
 
You don't execute modules: you execute subs or functions within modules.

Change

DoCmd.OpenModule "Module2", "First"

to

Call First()
 
You don't execute modules: you execute subs or functions within modules.

Change

DoCmd.OpenModule "Module2", "First"

to

Call First()

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)













- Näytä siteerattu teksti -


Thank you - again.

hanski
 
Back
Top