• refresh parent form

    Author
    Topic
    #1769555

    I am creating my first database. I have a form “ContactData” with an unlinked subform “AddressBook”. What I have managed to do is to allow the user to flip through the Address Book until they find the address they want, then press a command button with the event procedure:
    Me.Parent![Contact Last Name] = Me.Contact_last_name
    Me.Parent![Address ID] = Me.ID

    That links the last name and ID from the AddressBook subform to the last name and ID in the parent ContactData (I know this is redundant, but I was having trouble with DLookup). Now, the last name automatically appears in the parent form textbox but the ID textbox does not refresh until I move to the next parent record. Can I make them both automatically update within the button event procedure, and if so can you include the code, since I am having trouble with syntax?
    Thanks!

    Viewing 0 reply threads
    Author
    Replies
    • #1783751

      try me.requery

      • #1783752

        Thanks for the suggestion. I tried it and it seems to affect the subform rather than the parent form. When I click the button now, it will display the name as before, but now it goes back to the beginning of the address book. Perhaps I wasn’t clear before – the button is on the subform. Any other ideas/modifications? Should I somehow move the button onto the parent form? I didn’t know how to go about coding that.
        Thanks.
        Elly

        • #1783755

          If I understand the construct, perhaps Me.Parent.Requery will do the trick.

          • #1783761

            It still doesn’t update, and now it automatically moves to a new record if I am in data entry mode. Any other ideas?

            Elly

    Viewing 0 reply threads
    Reply To: refresh parent form

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: