Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating Forms (Access 2002)

    I have a main form that has multiple subforms; I use a pop-up form to make entries into my tables. I've noticed that when I close my pop-up form the subform does not reflect the entry of the last record entered. If I move to the next record on my main form and return the previous record the subform displays the record entered via the pop-up form. How do you get the subform to refresh when I close the pop-up form?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating Forms (Access 2002)

    In the on close event of the popup form you could use something like :
    Forms.MainFormName.SubFormControlName.Form.Requery
    In the above line I use SubFormControlName, this is not the name of the subform but the name of the control that contains the subform. They are not necessary the same.
    Francois

  3. #3
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating Forms (Access 2002)

    Thanks for your response; in the pop-up form I have a command button that closes the pop-up form. Where do I find the SubFormControlName in the properties box on the main form? Or is Control Name same as Record Source?

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating Forms (Access 2002)

    Open the main form in design view.
    Select the tab where the subform is.
    Klick once on the subform.
    Open the property window on the tab Others. The subform should be selected (with the expansion blocks around (see attachment))
    The name of the control is in the name property
    Francois

  5. #5
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating Forms (Access 2002)

    Thanks Very Much; worked perfectly. I have one question; what is the difference between requery and refresh?

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating Forms (Access 2002)

    From the help file :
    The Refresh method immediately updates the records in the underlying record source for a specified form or datasheet to reflect changes made to the data by you and other users in a multiuser environment.

    Requery Method:
    Updates the data in a Recordset object by re-executing the query on which the object is based.

    I suppose you could use the two in your case.
    Francois

Posting Permissions

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