By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,039 Members | 1,824 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,039 IT Pros & Developers. It's quick & easy.

requery a sub form

100+
P: 116
Hi.

Hope someone can help with the query which seems relatively easy yet I cant get it to work.

I have a main form and when I enter a figure "after update" i want another figure to be updated. The figure I want updated is a box in a subform within another subform. I have tried requery but it only refreshes the first subform.

Hope this makes sense.

Thanks

jacc14
Jul 22 '08 #1
Share this Question
Share on Google+
4 Replies


Expert Mod 2.5K+
P: 2,545
Hi. Subforms on main forms are treated as controls like any other. Their form properties are accessed using the Form qualifier. Assuming that the code for requerying your forms is in the outermost form (the main form) the requery of the nested subform can be done like this:

Expand|Select|Wrap|Line Numbers
  1. Me!firstcontrol.Form!secondcontrol.Form.Requery


replacing firstcontrol and secondcontrol with the actual names of your subform controls as used in your forms.

-Stewart
Jul 23 '08 #2

100+
P: 116
Hi Stewart
Thanks for the prompt reply. Unfortunately I have tried this and whilst it kicks up no errors the TOTAL field in the second subform does not change value.

Do I need to requery the actual field as well?

Thanks
jacc14
Jul 23 '08 #3

Expert Mod 2.5K+
P: 2,545
You may need to requery the first subform before you requery the second. Sorry to say it is difficult to advise without seeing how the total field is calculated (is it an unbound calculated field, a DSUM, or what)?

-Stewart
Jul 23 '08 #4

100+
P: 116
Hi Dont worry I have used your original advise and it now seems to have worked. Think I didnt do it right first time doh

Thanks
jacc14
Jul 25 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.