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

Refreshing a form - automatically

P: 6
How do I get a form to automatically refresh once (not continually using a timer).

The scenario I have uses a parent table and a child table.
(thanks to mmcarthy for indicating better termenology than I was using)
I have a main form that displays one page per parent record and all the related child records in a sub-form.
I then have a second form from which I can select records to be added (appended) to the child records. When the second form closes a query appends selected records to the child table. The problem I cannot solve is to get the main form, in particular to sub-form section, to update (refresh) automatically after I close the second form.

thanks
Iain
Sep 4 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
In the On Close (Button click or whatever) event on the second form put the following code. Be careful of the subform name, check the name under the Properties in the Other tab.

[CODE ]

Forms("NameOf ParentForm")![SubformName].Requery

[/code]

How do I get a form to automatically refresh once (not continually using a timer).

The scenario I have uses a parent table and a child table.
(thanks to mmcarthy for indicating better termenology than I was using)
I have a main form that displays one page per parent record and all the related child records in a sub-form.
I then have a second form from which I can select records to be added (appended) to the child records. When the second form closes a query appends selected records to the child table. The problem I cannot solve is to get the main form, in particular to sub-form section, to update (refresh) automatically after I close the second form.

thanks
Iain
Sep 4 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Sorry the CODE indicators shouldn't be showing

In the On Close (Button click or whatever) event on the second form put the following code. Be careful of the subform name, check the name under the Properties in the Other tab.


Expand|Select|Wrap|Line Numbers
  1.  
  2. Forms("NameOf ParentForm")![SubformName].Requery
  3.  
  4.  
Sep 4 '06 #3

P: 6
Thank you very much.

I had got close to the solution but had not realised that I must direct the requery command.

Iain
Sep 5 '06 #4

Post your reply

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