Results 1 to 5 of 5

Thread: Requerying...

  1. #1
    Join Date
    Mar 2004
    Posts
    77

    Unanswered: Requerying...

    Hi all,

    just wanna ask whether it is possible to requery a subform from another subform or from the mainform? The subform that needs to be requeried is based on a select query.

    if yes, how is it done?

    thx in advance.
    Last edited by chanjw; 03-25-04 at 21:36.

  2. #2
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    133

    Re: Requerying...

    I think
    Forms![MainForm]![SubformControlName].Form.Requery
    should work.

  3. #3
    Join Date
    Mar 2004
    Posts
    77
    thx, bmacr, for your answer.

    but after trying out your code, i noticed that the results of the requery is lagging behind by one click. maybe i did not explain clearly. the main form i have now contains 3 subforms. 2 of the subforms is based on tables, while the third one is based on a query. the one i'm trying to requery is the third form. let's call them form A, form B, and form C.

    now the situation is this, when i choose a record on form A, form B will show the related stuff of the record in form A. form C will then show the data that is related to form B.

    the code that bmacr provided, does requery form C. Strangely, the data shown is not of the present selected record, but of the previous record. what i want to do is when i choose the present record, form C will show the stuff related to the present record.

    Can anyone tell me what code to use?

  4. #4
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    133
    Your Form C is being requeried before Form B has been updated. You should have your requery code fire some time after Form B has updated. Try putting it in Form B's After Update event, or maybe its Current event.

  5. #5
    Join Date
    Mar 2004
    Posts
    77

    Wink

    funny thing now is that i have to click on form B before form C can requery... any idea on how to make form C requery right after i click on form A? i think i let form B and form C display their data simultaneously is better...

    thx for the previous tip, though.

Posting Permissions

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