Another form's button to activate.

Alex Motilal

New member
Local time
Tomorrow, 04:06
Joined
Jul 7, 2021
Messages
15
Hi all.
I have a form and on clicking a button another form will pop up to enter data. On clicking the Close button of the Pop Up form, the Update Button of the original form should activate (that is should act as if the button clicked).
Is it possible? If so please help me with the code.
Thanks.
 
Change the button's code from Private to Public and then in the second form

Forms!FirstFormName.ButtonName_Click()
 
you need to make the Click event of the button Public instead of private
before you can call it.
 
you need to make the Click event of the button Public instead of private
before you can call it.
Can you elaborate please. The second form's Close Button Event:
Code:
Private Sub Command10_Click()
On Error GoTo Command10_Click_Err

    DoCmd.Close , ""

Command10_Click_Exit:
    Exit Sub

Command10_Click_Err:
    MsgBox Error$
    Resume Command10_Click_Exit

End Sub
 
you can make this a little more seamless and less tightly coupled.

From the calling form if you open the form ACDIALOG in the windowmode, code execution will stop and then resume when the pop up closes

Code:
docmd.openform "popup form name",,, ACDIALOG
'Now run your code which will run after the popup closes
Your button_Click name here
also verify my commas. I believe it is the 4th argument.
 
not the pop-up form, the first form.
see this demo.
 

Attachments

Users who are viewing this thread

Back
Top Bottom