Subform shows up in both of the tab controls

  • Thread starter Thread starter Harper
  • Start date Start date
H

Harper

Hello,
I am having some issues with tab control. I am new to tab control and
so far cannot figure out what's going on.

Backstory: I have three subforms, UNLICENSED_subform, LICENSED_subform,

and STUTCH_SUPER_subform. Previously, they were on the form without tab

control. I had a nicely working script in which whether
UNLICENSED_subform or LICENSED_subform appeared, and whether the
STUTCH_SUPER_subform or a message appeared, depended on variable
"Licenseorno". It is as follows.


Private Sub Form_Current()
Select Case Me.LicenseorNo.Value


Case 0
Me.LICENSED_subform.Visible = False
Me.UNLICENSED_subform.Visible = False
Me.STUTCH_SUPER_subform.Visible = False
Me.UnsureTeachingLabel.Visible = True
Case 1
Me.LICENSED_subform.Visible = True
Me.UNLICENSED_subform.Visible = False
Me.STUTCH_SUPER_subform.Visible = True
Me.UnsureTeachingLabel.Visible = False
Case 2
Me.LICENSED_subform.Visible = False
Me.UNLICENSED_subform.Visible = True
Me.STUTCH_SUPER_subform.Visible = True
Me.UnsureTeachingLabel.Visible = False


End Select
End Sub


I threw the tab control in then and whamo my script stopped working
because it failed to recognize the subforms. So I deleted them, and
then proceeded to bind them to tab control. So far I have
LICENSED_subform bound to the first tab and when I tested the form
again I found that I didn't get a code error for all of them, as I had
before, only for the ones I hadn't yet put back in. Great! But the
problem is, when I go to bind UNLICENSED_subform onto the first tab as
well (same procedure as with LICENSED_subform, only I just lay
UNLICENSED_subform on top of it), it appears also on the second tab
(and LICENSED_subform does not). Is this because I have not completed
returning my subforms to the form, and so the code error is making
things behave weirdly? I really don't think so because in the design
view I can see that UNLICENSED_subform is attached to both tabs and
LICENSED_subform is not. (And obviously I'm not running code there so
the error isn't affecting that.) Am I missing something, or is it not
possible to put two subforms on one tab?


Thanks for any help in advance.
Harper
 
i'm not sure what you mean by "binding" a subform (or any other control) to
a tab control. you can put one or more controls on a tab page, but that just
means they're sitting on the page, not "bound" to it. there should be no
problem with putting more than one subform control on a single tab page.
when I go to bind UNLICENSED_subform onto the first tab as
well (same procedure as with LICENSED_subform, only I just lay
UNLICENSED_subform on top of it), it appears also on the second tab
(and LICENSED_subform does not).

in order to put any control onto a tab page, you need to first select the
tab page, then you can create or paste the control onto the page. if you
have the control elsewhere on the form, outside of the tab control, and
simply drag it onto the tab control, it will actually be sitting on the form
section - and will be visible on all the tab pages.

hth
 
Back
Top