Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Posts
    18

    Unanswered: Avoid loading subform when changing record

    I have a form with a really heavy subform.
    Of course, I want this subform to be loaded only when a button is pressed.
    The solution used is to replace the subform with a new empty form, and use

    Me.Subform.SourceObject = "OriginalSubform"

    in the event OnClick of the button. In this way, when the form is opened, the subform field is the empty one, and the heavy original subform is loaded only on request.

    But.. if i press the button (loading the subform) and I switch to the next record, the data of the subform are loaded again..

    Is there a way to avoid this? the event Deactivate acts only if I change form, the others (Current, onLoad, etc) act AFTER having loaded the subform..

    Thank you all

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    This question comes up frequently in one form or another.

    What you need to do is hide the default navigation buttons on your form,
    and build your own navigation buttons. In the OnClick event for your navigation buttons, you can reset the source object for your subform, before moving on to the next record.

    Mark
    Inspiration Through Fermentation

  3. #3
    Join Date
    Sep 2003
    Posts
    18
    That's a very good idea!

    Is it possible to create navigation buttons looking like the default ones, or I have to build up all them by hand?

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    If you use the wizard, there are several left and right arrow buttons to choose from.
    Inspiration Through Fermentation

Posting Permissions

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