Populate main form from subform record

Discussion in 'Access' started by howard_hong, Feb 11, 2017.

  1. howard_hong

    howard_hong

    Joined:
    Feb 11, 2017
    Messages:
    1
    Likes Received:
    0
    Hello,

    In Access 2016, I have a main form, ClientInfoForm, which contains a subform, EditTransactions_subform. The subform is in datasheet view. When the user clicks a record in the subform, I want to populate fields in the main form. In the subform's Click event, I currently have:

    Public Sub Form_Click

    Forms![ClientInfoForm]![Amendment] = Forms![ClientInfoForm]![EditTransactions_subform].Form![Amendment]

    End Sub

    I am not sure if this is the right code to execute what I want. The name of the field is [Amendment] in both the subform and the main form.

    Thanks in advance for your help!

    Howard
     
    howard_hong, Feb 11, 2017
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.