Form Recordset Update from Action on another Form (1 Viewer)

J_Cat

Registered User.
Local time
Today, 06:09
Joined
May 7, 2012
Messages
12
Hi All,

I'm on tabbed form [FORM1] and I'm looking to requery (refresh) the recordsource on Tab A, subform A, based on activity (e.g. checking a checkbox) in Tab B, Subform B.

Does anyone know how to use VBA to force a refresh on a subform's recordsource without that subform being currently visible to the user?
:banghead:

Thanks in advance!
John
 

bob fitz

AWF VIP
Local time
Today, 14:09
Joined
May 23, 2011
Messages
4,728
Try:
Me!OfSubformAControlName.Form.Requery
in the after update event of the checkbox. You will need to substitute OfSubformAControlName with the name of the control that holds the subform to be requeried.
 

John Big Booty

AWF VIP
Local time
Today, 23:09
Joined
Aug 29, 2005
Messages
8,262
Check out this link for the correct syntax for referring to form/subforms, their control and properties from various relative locations.

So in your instance in the On Click event of your check box you could use some code along the lines of;
Code:
Forms!Mainform!Subform1.Form.Requery
 

J_Cat

Registered User.
Local time
Today, 06:09
Joined
May 7, 2012
Messages
12
Thanks all,
I took that advice and it seems like it's doing the trick!
JO
 

Users who are viewing this thread

Top Bottom