Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Refresh Subform (Access 2000)

    I have a main form (Mainform) with 2 subforms. The first subform (Firstsubform) has Yes/No fields. The second subform is from a query that counts the number of Yes/No entered in the first subform of this record. All forms are linked by an ID#.

    My problem

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

    Re: Refresh Subform (Access 2000)

    If the second subform depends on the first one, you should link it to the first subform, not to the main form. You may need to have another field bnesides the ID to link them on.

    Perhaps you can put the second subform inside the first. If that is not possible, you must use a little trick to link them: put text boxes on the main form that refer to the controls on the first subform to be used for linking. The control source would be something like
    =[sbfSubform1]![txtID]
    Name this text box (for example) txtSub1ID, and use this name as master linking field for the second subform (you can't enter this using the builder, you must enter it manually)

  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: Refresh Subform (Access 2000)

    Assuming that the subform controls on your mainform are in fact named FirstSubform and SecondSubform (note I said the control names, not necessarily the form names). To requery the 2nd subform from within the first subform, you would use a line of VBA code like this:
    Me.Parent.SecondSubform.form.requery
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Refresh Subform (Access 2000)

    Thanks! I moved the second subform inside the first subform, and used your code. This did the trick! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

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