Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update subform (Access 2000)

    I have a subform (SF_Courtrooms) on a form (Courtrooms).

    The form "Courtrooms" remains open as the user then goes to another form (MCourtrooms) which edits the information displayed in the first form's subform (SF_Courtrooms). When I close the second form (MCourtrooms), I naturally want 'SF_Courtrooms' to update.

    I've tried "Me.SF_Courtrooms.Requery" in the 'oncurrent' property of 'Courtrooms' but that doesn't work.

    So how can I achieve this?

    I seem to remember that changing the view in 'Courtrooms' to print preview and then back to normal will achieve this but I can't figure out how to do this either.

    Thanks for your time.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update subform (Access 2000)

    Try Me.SF_Courtrooms.Form.Requery

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update subform (Access 2000)

    Thanks Hans, however although I've tried this with both the 'on current' and 'on got focus' properties of 'Courtrooms', which contains 'sf_Courtrooms', but it still wont update when the edit screen closes.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update subform (Access 2000)

    Try initiating the requery from the On Close event of MCourtrooms. In the following, I assumed that MCourtrooms is always opened from Courtrooms; if it can be opened by itself, or from other forms, the code will need to be expanded slightly.

    Private Sub Form_Close()
    Forms!Courtrooms!sf_Courtrooms.Form.Requery
    End Sub

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update subform (Access 2000)

    Thanks Hans, that works perfectly.

Posting Permissions

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