I have a main form and another form that pops open when a combo box is double clicked to add/delete records from that combo. This same pop up form is accessed from another place in the database as well. I'd like to have a command sent from the pop up form that will send a save command to the main form only if the main form is open. Is this possible?
First of all you need to create a public Sub or function in the Main Form(Form1 in this scenario)
Public Sub Test()
MsgBox "Hello world!"
Then you will be able to call the function or sub from anywhere in your project as long as the form is open. Not that you will have to reference the form and then th efunction eg. Forms("FORMNAME").FUNCTION
You will put this code in your pop-up. Comments are in the code
Dim x As Integer
'Check if any Forms are open
If Forms.Count > 0 Then
'Loop through all the forms and check if the form is open
For x = 0 To Forms.Count - 1
'If it is open run the function
If Forms(x).Name = "Form1" Then