Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Populating A SubForm (2002)

    I am trying to populate both a Form and a Subform based on the AfterUpdate event in one of the Controls in the Form. The Form populates successfully - using an ADO Recordset. Populating the Subform, however, is a "non-event". At the moment, I am passing a value to a hidden Control on the Parent, using Subform.SetFocus and then running code on the GotFocus event in the SubForm - to check the value of the Parent!HiddenControl. What is a more effective way of going about this?
    Gre

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating A SubForm (2002)

    So: the code for the GotFocus event should be run in whichever Subform Control has a tab Index of 0.

    However, instead of populating the full series of (up to) 25 records in the Subform, the single default record is overwritten (up to) 25 times.<pre>DoCmd.GoToRecord acDataForm, "[subform]", acNewRecord</pre>

    has no effect. Any other ideas?
    Gre

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Populating A SubForm (2002)

    Why not simply requery the subform? Or am I missing something?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating A SubForm (2002)

    Requerying the subform does provide the final step.

    It turns out that running an Append Query was the key thing I was still looking for. (Perhaps that was not at all clear from the way that I phrased the question!)
    Gre

Posting Permissions

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