Syntax for addressing tab components on a form

J

Joe D

Writing some VBA code to periodically change the tab caption and and subform
source on each of several tabs on a form. Stumped on proper syntax. This is
the code format generally. Approach works on a form with no tabs, but can't
seem to find right way to deal with tab properties.
-----------------------------
DoCmd.OpenForm NameOfForm, acDesign

With Forms(0)
{some code}Tab01.Caption = "Some Caption"
{some code?}Tab01.SubForm01.Source = "Some Source"
End With
------------------------------

TIA for any help. I know someone out there knows how to do this one. I
searched Help and this forum, but can't seem to find it. It's probably right
in front of me somewhere and is very simple. I really appreciate any help on
this.

Joe D
 
J

Joe D

Well, I stumbled on it a few minutes after this post:

DoCmd.OpenForm NameOfForm, acDesign

With Forms(0)
!Tab01.Caption = "Some Caption"
!SubForm01.SourceObject = "Some Source"
End With

I guess it was too easy for me to see this late at night. :cool:

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top