Results 1 to 5 of 5
  1. #1
    Elly
    Guest

    refresh parent form

    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!

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: refresh parent form

    try me.requery

  3. #3
    Elly
    Guest

    Re: refresh parent form

    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

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: refresh parent form

    If I understand the construct, perhaps Me.Parent.Requery will do the trick.
    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

  5. #5
    Elly
    Guest

    Re: refresh parent form

    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

Posting Permissions

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