A long time ago in a galaxy far far away, Ryan wrote an article on accessing controls on other forms but did you know you can also access another form’s scripts?
Here is a sample on how to do that:
For i = 0 to Application.Forms.Count – 1
If Application.Forms(i).Name = “frmAccountDetail” Then
Set frm = Application.Forms(i)
In this script I loop through the application’s forms collection and look for a form with the name of “frmAccountDetail”. If I find it then in instantiate the object frm variable and set it to the form I have found. Now I call the frm.Script collection which then exposes all of the functions and sub routines on that form. In my sample I am calling a sub routine called “TestCall”.
Simple and useful.