"Dikkie Dik" <Ab***@SpamBusters.com> wrote in message
news:3f***********************@dreader-2.news.scarlet-internet.nl...
J French wrote:
On Wed, 07 Jan 2004 22:44:16 GMT, "Harry J. Smith"
<hj*****@ix.netcom.com> wrote:
In my program VPCalc, Public procedures in a Form are not visible to
other Modules.
Is this how it should be?
Form1.MyProc
Well, yes and no.
They should be public and they probably are: they are public methods
of any instance of the form. So if you have defined a variable as the the
type of your form (supposing is is called "Form1" here):
dim frm as Form1 ' every form definition has its own type
set frm=new Form1 ' create a new instance. You could also get it out
' of the Forms collection
frm.VPcalc ' When you type the dot, VPcalc should be in the
' autocomplete list, as it is public.
Best regards,
Dikkie Dik
Thanks, this works great.
First I found that after the new instance of the form, you can ignore
the frm variable:
dim frm as Form1
set frm=new Form1 'Bring up Form1
Set frm = Nothing 'No longer need frm
Form1.VPCalc 'Call the Sub VPCalc
Then I removed the first three lines and the form came up anyway:
Form1.VPCalc 'Call the Sub VPCalc
I tried doing the first two lines by themselves and the form did not
come up. They appear to do nothing but set frm which is not needed.
I will just do the one-liner and be happy I have a solution.
-Harry