UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Requery/refresh A Subform On A Form, When Close Another Form, Office 2010    
 
   
jgaskell
post 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.



Go to the top of the page
 
+
Alan_G
post May 28 2012, 08:55 AM
Post #2

Utterly Yorkshire and Forum/Wiki Editor
Posts: 15,886
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
Go to the top of the page
 
+
jgaskell
post 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.
Go to the top of the page
 
+
Alan_G
post May 28 2012, 10:41 AM
Post #4

Utterly Yorkshire and Forum/Wiki Editor
Posts: 15,886
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 the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 26th May 2013 - 12:19 AM