Re: How to run a module?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

Change

DoCmd.OpenModule "Module2", "First"

to

Call First()

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


"hanski" <lappalainen.hannu@xxxxxxxxxx> wrote in message
news:a5cea7c4-d28a-4594-8dc9-caa75b7a6205@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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


.



Relevant Pages

  • Re: Access module does not continue past the Filter Method
    ... Execute the procedure, and single-step through it with F8 so you can trace ... Public Sub Apply_Tech_Filter ... Debug.Print "Past the Filter" ... Debug.Print "Before the Append Statement" ...
    (microsoft.public.access.modulesdaovba)
  • Re: Error:Invalid procedure call or argument
    ... > Number 0 everytiime I execute this code: ... > Private Sub Update() ... > On Error GoTo ErrHand ... > Following is an example of the completed SQL string. ...
    (microsoft.public.access.formscoding)
  • Re: Using ADO.NET to prcoess T-SQL batches
    ... The way cool additional thing Whidbey ADO.NET v2 provides for this is the ... > only execute batches under a certain size, either 40K or 80K, if I ... >> Print statements return their data to an ADO.NET client as InfoMessages. ... Private Sub Button1_Click(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Code wont execute Main Macro Calls - non breaking spaces
    ... Public Sub MainMacro() ... Sub DoFindReplace(FindText As String, ReplaceText As String, ... My MAIN MACRO does not execute the first 2 options DO FIND AND REPLACE. ...
    (microsoft.public.word.vba.general)
  • Re: Code wont execute Main Macro Calls - non breaking spaces
    ... Public Sub MainMacro() ... Sub DoFindReplace(FindText As String, ReplaceText As String, ... My MAIN MACRO does not execute the first 2 options DO FIND AND REPLACE. ...
    (microsoft.public.word.vba.general)