Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002

    Unanswered: save command on another form

    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?

  2. #2
    Join Date
    Feb 2003
    Auckland, NZ


    It is 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!"
    End Sub
    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
                End If
        End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts