Call proceedure in a form

F

franky

How do i call (reference) a public proceedure in a form from another form?

Thanks in advance!
 
F

franky

I figured it out. Hopefully this is the correct way to do it.

Dim frm as form

Set frm = Forms!myForm
frm.ProceedureName

Thanks
 
M

Marshall Barton

franky said:
How do i call (reference) a public proceedure in a form from another form?


A form's module is a Class Module and procedures in a class
module are methods of the class. From that generalization,
the syntax would be:

Function:
xx = Forms!otherform.procedurename(arglist)
Sub:
Call Forms!otherform.procedurename(arglist)
or
Forms!otherform.procedurename arglist

Note that otherform must be open before it becomes a member
of the Forms collection.

If otherform is not open, you can use the syntax
Form_otherform.procedurename, but that is not the same thing
in cases where the procedure relies on data within the form
or its module.
 
D

David C. Holley

Actually that's not neccessary you can do it with

Call Form_subfrmCodedRemarks.setSQLStatement("Confirmation")
[form module name].[procudure name] (any required parameters)
 
Top