By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,900 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,900 IT Pros & Developers. It's quick & easy.

Call Function

P: n/a
What is the syntax to call Public Function MyFunction(parm1, parm2) in
MyForm's module from a function in a standard module?

Thanks,

Steve
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You have to get an instance of the form loaded to do this.

Dim f As Form_MyForm
Dim parm1
Dim parm2

DoCmd.OpenForm ("MyForm")

Set f = Forms("MyForm")

Call f.MyFunction(parm1, parm2)

Set f = Nothing

DoCmd.Close acForm, "MyForm"
...

--
Terry Kreft
"Steve" <no****@nospam.spam> wrote in message
news:AL****************@newsread2.news.atl.earthli nk.net...
What is the syntax to call Public Function MyFunction(parm1, parm2) in
MyForm's module from a function in a standard module?

Thanks,

Steve

Nov 13 '05 #2

P: n/a
Terry,

Will this work?

MyForm is already open before the function in the standard module is run. So
just put this line of code in the function:
Call Forms!MyForm.MyFunction(parm1, parm2)

Thanks,
Steve

"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:Dw********************@karoo.co.uk...
You have to get an instance of the form loaded to do this.

Dim f As Form_MyForm
Dim parm1
Dim parm2

DoCmd.OpenForm ("MyForm")

Set f = Forms("MyForm")

Call f.MyFunction(parm1, parm2)

Set f = Nothing

DoCmd.Close acForm, "MyForm"
...

--
Terry Kreft
"Steve" <no****@nospam.spam> wrote in message
news:AL****************@newsread2.news.atl.earthli nk.net...
What is the syntax to call Public Function MyFunction(parm1, parm2) in
MyForm's module from a function in a standard module?

Thanks,

Steve


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.