My Assistant
![]() ![]() |
|
|
May 28 2012, 08:38 AM
Post
#1
|
|
|
UtterAccess Enthusiast Posts: 77 |
Hello,
I am struggling to refresh a subform. I have a main form that is a popup, called frmBOC. I click a button on frmBOC to open another data entry form that fills in data on a subform (frmsubBOC), on frmBOC. This is also a popup form, called frmADD. When I close frmADD I would like the subform to requery or refresh to show the new line. I have tried all sorts of variations in the on activate, and on get focus events of frmBOC and none of them work. All I can do is use F5 or F9 to update the subform. Thanks for any advice. |
|
|
|
May 28 2012, 08:55 AM
Post
#2
|
|
|
Utterly Yorkshire and Forum/Wiki Editor Posts: 15,882 From: Devon UK |
Hi
If you're closing frmADD from a command button then you can use the button's click event, or you could use the form's close event but wherever you want to run the code from it would be CODE Forms!frmBOC!frmsubBOC.Form.Requery frmsubBOC in the code above would need to be the name of the subform control which may or may not be the same name as the form you're using as a subform |
|
|
|
May 28 2012, 10:31 AM
Post
#3
|
|
|
UtterAccess Enthusiast Posts: 77 |
Thanks, that worked perfectly - I just didn't have the syntax quite right - I'm a bit rusty I'm afraid.
Great to have such a speedy answer. |
|
|
|
May 28 2012, 10:41 AM
Post
#4
|
|
|
Utterly Yorkshire and Forum/Wiki Editor Posts: 15,882 From: Devon UK |
(IMG:style_emoticons/default/yw.gif) - glad you got it working. For future reference here's a link for the syntax for referring to subforms/reports
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 04:41 PM |