Access VBA Reference subform on tab

shamas21

Registered User.
Local time
Today, 19:35
Joined
May 27, 2008
Messages
162
Hi all

I have a form called "Form1".

Within Form1 I have a tab control with 1 tab on it called "Tabs1".

Within Tab1 I have another tab control on it with 1 "Tabs2".

Within one of my tabs on Tab2 I have a subform called "sbFrm1" using a query as its data. the query is called "Query1".

What I want to do is have a button on Form1 to referesh the data on "sbFrm1"

I have the following syntax built on the expression builder but it doesnt work in vba

Code:
Forms![Form1]![Tab1]![Child143].Form![sbFrm1].Form.recordsource = "This Record"

Any help is appreciated

Thanks
 
To refer to a subform on a main form or on a Tab is the same. The tabs mean nothing so refer directly to the subform.

Code:
Me.sbFrm1.Form.Recordsource.Requery

Se this link for a explenation on tabed pages:

http://www.mvps.org/access/forms/frm0025.htm

JR
 

Users who are viewing this thread

Back
Top Bottom