A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to run a module?



 
 
Thread Tools Display Modes
  #1  
Old July 2nd, 2008, 12:21 PM posted to microsoft.public.access.forms
hanski
external usenet poster
 
Posts: 60
Default How to run a module?

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
  #2  
Old July 2nd, 2008, 12:30 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default How to run a module?

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" wrote in message
...
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



  #3  
Old July 3rd, 2008, 06:00 AM posted to microsoft.public.access.forms
hanski
external usenet poster
 
Posts: 60
Default How to run a module?

On 2 heinä, 14:30, "Douglas J. Steele"
wrote:
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!)

"hanski" wrote in message

...



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- Piilota siteerattu teksti -


- Näytä siteerattu teksti -



Thank you - again.

hanski
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.