Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2013
    Posts
    2

    Unanswered: Populate bound field controls on a main form by selecting a record in a subform

    I saw a demo of a form with bound controls on the main form and a datashteet view of the same table in what looked like a subform. When a record was clicked in the subform datasheet, the controls on the main form were updated with that records information. Basically, the main form was synched to the same record as the subform. Any idea how to do this?

    The datasheet in the subform showed all of the table records, not just the one displayed on the main form.

  2. #2
    Join Date
    Nov 2011
    Posts
    413

    Populate Main form via Subform

    Here is an example of using one form to populate another.You could use
    Me.([somename]) = [anothername]

    PHP Code:
    Private Sub Command11_Click()                       'Purpose: Copy popup form data onto check.

    [Forms]![BlankChecksx]![account1] = Me.account1
    [Forms]![BlankChecksx]![account2] = Me.account2
    [Forms]![BlankChecksx]![account3] = Me.account3
    [Forms]![BlankChecksx]![routingnumber] = Me.routingnumber

     DoCmd.Close acForm, "frmCheckDetails" 

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    It sounds like the new split form. To recreate it, I'd manipulate the record source of the main form in the current event of the subform, along the lines of:

    Forms.MainFormName.RecordSource = "SELECT * FROM TableName WHERE KeyFieldName = " & Me.KeyFieldName

    substituting all the appropriate table, field and control names.
    Paul

  4. #4
    Join Date
    Jul 2013
    Posts
    2
    Thanks for the replies. I had no idea about the split form, in particular. So simple!!

  5. #5
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Happy to help!
    Paul

Tags for this Thread

Posting Permissions

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