Tabcontrols on a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

1st can you even put tab controls on a report? I have put the control on the
report but when it runs it just shows a grey box were the control is located.

Assuming that this is something easy to fix, can you use the same code as
for a form to display only selected tabs of the control when the report is
previewed or printed?
 
Tab controls are relevant to forms, but since a report is designed to print
out data, there'd be no way on the printed out version to "tab".

Can you describe what you are trying to do (rather than HOW)?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I can't imagine any reason to place a tab control on a report. You might
want to use subreports. You can make some visible or invisible based on your
needs at runtime.
 
Reason I want to use tabs: I have a report that gives some data on material
we produce. If the material is one type I also need to report some other
data on teh same report, if the material is a second type I need to report
different data. I use a tabcontrol in a form and show only the relavent tab
depending on the type of material I am collecting data on. I hoped I could
do something similar for when I need to report the information, by putting
the relavent sub report on each tab and showing or hiding the tabs as needed.

Duane: i had not thought abut hiding and showing only selected sub reports.
I am not sure how to do this based on the value of another control, in this
case the contol would be text box in the report header that contains
material type, the sub reports are in the LOT footer. Can you give an
example? IT would be very much appreciated.
 
You code would be in the format event of the same section as your
subreports.

Me.sbrptOne.Visible = Me.txtSomeTextBox = "SomeValue"
 
Duane:

Sorry for being dense. But i am not sure if I understand. The text box can
have one of three values, depending on product type. Each product type has a
seperate sub report. So do I need some code like.

'Hide all sub forms
Me.sbrptOne.Visible = False
Me.sbrpttwo.Visible = False
Me.sbrptthree.Visible = False

If [TEXTBOX] = "TYPEA" Then
Me.sbrptOne.Visible = true
elseif [TEXTBOX] = "TYPEB" Then
Me.sbrpttwo.Visible = true
elseif [TEXTBOX] = "TYPEc" Then
Me.sbrptthree.Visible = true
 
This should work:

Me.sbrptOne.Visible = (Me.[TEXTBOX] = "TYPEA")
Me.sbrpttwo.Visible = (Me.[TEXTBOX] = "TYPEB")
Me.sbrptthree.Visible = (Me.[TEXTBOX] = "TYPEc")

--
Duane Hookom
MS Access MVP

ED007 said:
Duane:

Sorry for being dense. But i am not sure if I understand. The text box
can
have one of three values, depending on product type. Each product type
has a
seperate sub report. So do I need some code like.

'Hide all sub forms
Me.sbrptOne.Visible = False
Me.sbrpttwo.Visible = False
Me.sbrptthree.Visible = False

If [TEXTBOX] = "TYPEA" Then
Me.sbrptOne.Visible = true
elseif [TEXTBOX] = "TYPEB" Then
Me.sbrpttwo.Visible = true
elseif [TEXTBOX] = "TYPEc" Then
Me.sbrptthree.Visible = true

Duane Hookom said:
You code would be in the format event of the same section as your
subreports.

Me.sbrptOne.Visible = Me.txtSomeTextBox = "SomeValue"
 
Thanks i tried my code it works as well but yours seems much simpler. The
lack of the parenthesis was throwing me off the first time around I assume
that the stuff in the parenthasis returns true or flase.



Duane Hookom said:
This should work:

Me.sbrptOne.Visible = (Me.[TEXTBOX] = "TYPEA")
Me.sbrpttwo.Visible = (Me.[TEXTBOX] = "TYPEB")
Me.sbrptthree.Visible = (Me.[TEXTBOX] = "TYPEc")

--
Duane Hookom
MS Access MVP

ED007 said:
Duane:

Sorry for being dense. But i am not sure if I understand. The text box
can
have one of three values, depending on product type. Each product type
has a
seperate sub report. So do I need some code like.

'Hide all sub forms
Me.sbrptOne.Visible = False
Me.sbrpttwo.Visible = False
Me.sbrptthree.Visible = False

If [TEXTBOX] = "TYPEA" Then
Me.sbrptOne.Visible = true
elseif [TEXTBOX] = "TYPEB" Then
Me.sbrpttwo.Visible = true
elseif [TEXTBOX] = "TYPEc" Then
Me.sbrptthree.Visible = true

Duane Hookom said:
You code would be in the format event of the same section as your
subreports.

Me.sbrptOne.Visible = Me.txtSomeTextBox = "SomeValue"

--
Duane Hookom
MS Access MVP

Reason I want to use tabs: I have a report that gives some data on
material
we produce. If the material is one type I also need to report some
other
data on teh same report, if the material is a second type I need to
report
different data. I use a tabcontrol in a form and show only the
relavent
tab
depending on the type of material I am collecting data on. I hoped I
could
do something similar for when I need to report the information, by
putting
the relavent sub report on each tab and showing or hiding the tabs as
needed.

Duane: i had not thought abut hiding and showing only selected sub
reports.
I am not sure how to do this based on the value of another control, in
this
case the contol would be text box in the report header that contains
material type, the sub reports are in the LOT footer. Can you give an
example? IT would be very much appreciated.

:

I can't imagine any reason to place a tab control on a report. You
might
want to use subreports. You can make some visible or invisible based
on
your
needs at runtime.
--
Duane Hookom
MS Access MVP

1st can you even put tab controls on a report? I have put the
control
on
the
report but when it runs it just shows a grey box were the control is
located.

Assuming that this is something easy to fix, can you use the same
code
as
for a form to display only selected tabs of the control when the
report
is
previewed or printed?
 
(the stuff in the parenthesis returns true or false) = True

--
Duane Hookom
MS Access MVP

ED007 said:
Thanks i tried my code it works as well but yours seems much simpler. The
lack of the parenthesis was throwing me off the first time around I assume
that the stuff in the parenthasis returns true or flase.



Duane Hookom said:
This should work:

Me.sbrptOne.Visible = (Me.[TEXTBOX] = "TYPEA")
Me.sbrpttwo.Visible = (Me.[TEXTBOX] = "TYPEB")
Me.sbrptthree.Visible = (Me.[TEXTBOX] = "TYPEc")

--
Duane Hookom
MS Access MVP

ED007 said:
Duane:

Sorry for being dense. But i am not sure if I understand. The text
box
can
have one of three values, depending on product type. Each product type
has a
seperate sub report. So do I need some code like.

'Hide all sub forms
Me.sbrptOne.Visible = False
Me.sbrpttwo.Visible = False
Me.sbrptthree.Visible = False

If [TEXTBOX] = "TYPEA" Then
Me.sbrptOne.Visible = true
elseif [TEXTBOX] = "TYPEB" Then
Me.sbrpttwo.Visible = true
elseif [TEXTBOX] = "TYPEc" Then
Me.sbrptthree.Visible = true

:

You code would be in the format event of the same section as your
subreports.

Me.sbrptOne.Visible = Me.txtSomeTextBox = "SomeValue"

--
Duane Hookom
MS Access MVP

Reason I want to use tabs: I have a report that gives some data on
material
we produce. If the material is one type I also need to report some
other
data on teh same report, if the material is a second type I need to
report
different data. I use a tabcontrol in a form and show only the
relavent
tab
depending on the type of material I am collecting data on. I hoped
I
could
do something similar for when I need to report the information, by
putting
the relavent sub report on each tab and showing or hiding the tabs
as
needed.

Duane: i had not thought abut hiding and showing only selected sub
reports.
I am not sure how to do this based on the value of another control,
in
this
case the contol would be text box in the report header that
contains
material type, the sub reports are in the LOT footer. Can you give
an
example? IT would be very much appreciated.

:

I can't imagine any reason to place a tab control on a report. You
might
want to use subreports. You can make some visible or invisible
based
on
your
needs at runtime.
--
Duane Hookom
MS Access MVP

1st can you even put tab controls on a report? I have put the
control
on
the
report but when it runs it just shows a grey box were the control
is
located.

Assuming that this is something easy to fix, can you use the same
code
as
for a form to display only selected tabs of the control when the
report
is
previewed or printed?
 
Back
Top