Execute a Command Button on Diff Form (1 Viewer)

eason

Registered User.
Local time
Today, 07:00
Joined
Nov 3, 1999
Messages
31
I have a main form that contains a sub form. On the main form I have a commad button that refreshes and requeries the sub form. I also have a command button that opens a popup form to add new contracts. What I would like to do is have the popup form execute the requery command button on the main from when the popup form is closed. Is this possible??? :confused:
 

dcx693

Registered User.
Local time
Today, 08:00
Joined
Apr 30, 2003
Messages
3,265
Put some code into the Close event of the pop-up form. You can just reference the code event that is running the requerying of the subform. For example, if it's the Click event of the cmdCommand1 button, then reference it like this:
Call Forms("myformName").cmdCommand1_Click()

Just make sure that the cmdCommand1_Click() code is not marked private. I.e., the code should look like:
Code:
Sub cmdCommand1_Click()
    'your code is in here
End Sub
and not:
Code:
Private Sub cmdCommand1_Click()
    'your code is in here
End Sub
 

Users who are viewing this thread

Top Bottom