call functions on other open forms

alfi

New member
Local time
Today, 15:12
Joined
Nov 14, 2008
Messages
9
Hi guys

Is there a way to call a public function on an open form when the method name is a string like this :

Forms(formName).functions(functionName)

and not the usual

Forms(formName).functionName

In other words is there a collections of public functions in a form ?? I want to create a generic function that will receive the name of the form and the function name as strings parameters and to use those parameter to call the forms method.

Have a good one and thanks

Alfi
 
Not sure what this is what you are after, but you could do something like the following ....

Create a module and place your public function there., ie ...

Code:
Public Function funcFunctionName(sFormName As String)
 
Dim frm As Form 
Set frm = Forms(sFormName)
 
'from here you should be able to reference the form - frm.Controls, etc...
 
End Function

Call your function from wherever and pass the form name you are referencing.

Hope that helps,
-dK
 

Users who are viewing this thread

Back
Top Bottom