Refer to a subform on a tab on a form

  • Thread starter Bill (Unique as my name)
  • Start date
B

Bill (Unique as my name)

I have a form named ftabtova.
On the form I have a tab control, TabCtl0.
On TabCtl0, under one the tabs, MUM Vehicle Reservations, I have a
subform, ftabvr.

How do I refer to this subform in VBA?
The code below says it cannot find ftabvr.

I am crestfallen. :(

For tabvropen = 101 To 107
Forms!ftabvr!TabCtl0.Controls("T" & CStr(tabvropen)) = " " &
Forms!ftabvr!TabCtl0!Text335
Next tabvropen

Thank you very much in advance.
 
K

Ken Snell \(MVP\)

Controls on a tab control are also considered to be controls on the form
that holds the tab control. Thus, you can refer to the subform directly just
as if it were on the form and not on the tab control. The usual problem is
that you're using the SourceObject and not the Name of the subform control
when you reference it.

Me.NameOfSubformControl
 
B

Bill (Unique as my name)

Thank you, Ken.
Things are working great.
Controls on a tab control are also considered to be controls on the form
that holds the tab control. Thus, you can refer to the subform directly just
as if it were on the form and not on the tab control. The usual problem is
that you're using the SourceObject and not the Name of the subform control
when you reference it.

Me.NameOfSubformControl
 

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