Results 1 to 3 of 3
  1. #1
    Join Date
    May 2011

    Unanswered: Tabbed Forms Parameters

    Hi All

    First time on this forum but would really appreciate any help offered.

    I'm trying to pass the parameters from one tab control to the other but am having trouble finding the solution to what I want to do.

    I have a form with 2 tabs - CustomerList & CustomerDetails

    The CustomerList tab contains a subform which is based on tblCustomers and shows all records in summary format within the customer table. The CustomerDetail tab is based on a query which simply shows the details of a selected customer.

    What I would like to do is allow the user to Double Click on any customer in the CustomerList tab and they are then taken to the that customers details. I can get the double click event no problem but don't know how I can pass the CustomerID from the subform to the main form and display the correct record.

    This has been bugging me for days now so any help would be great


  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    To retrieve the value of a control on a subform from the main (parent) form the syntax is:
    or if you prefer to use the full syntax (that also works from outside the main form class module):
    See also: Forms: Refer to Form and Subform properties and controls
    Have a nice day!

  3. #3
    Join Date
    Sep 2006
    Surrey, UK
    Provided Answers: 2
    I have something similar working. A form displays a subform of work to be carried out. When you click an item in the subform, details about it are transferred to the parent form. This is achieved by the subform's Current event:
    Private Sub Form_Current()
        'Dump the selected record into the designated text box on the main form
        Forms!ParentFormNameHere.TextBoxNameHere = Me.FirstTextBoxNameHere & " - " & Me.SecondtextboxNameHere
    End Sub
    Replace the object names with the ones from your forms. Please note that my version requires that the values to be transferred to the parent form are displayed in the main form. If you don't want to display them all, you can use DLookup or generate an SQL string and get the values from a recordset if you prefer.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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