Export don't show all Textboxes

S

Sebastian

I have a report which calculates on an condition some textboxes:

Private Sub Detail_Print()

If Me.Text62 > 30 Then
'Me.Text62.Visible = False
Me.Textover30.Visible = True
Me.Text15to30.Visible = False
Me.Text2to15.Visible = False
Me.Text0to2.Visible = False
Me.Textfuture.Visible = False
ElseIf Me.Text62 <= 30 And Me.Text62 >= 15 Then
'Me.Text62.Visible = False
Me.Text15to30.Visible = True
Me.Textover30.Visible = False
Me.Text2to15.Visible = False
Me.Text0to2.Visible = False
Me.Textfuture.Visible = False

etc........

End If

As you can see I want to show some textboxes only if the condition is
true. Over this way I show for each row a number in one field is
between 0 and 2, 15 to 30 etc. I couldn't find another way.

Now, when I export this report into and EXCEL format I can see only
one colum. for example TextOver30.
All the others are not visible... and the column is named like one
textbox.

Example

This is what I get in the report and it should be in the .xls export.

days age
0 0 to 2 days
30 over 30 days
25 15 to 30 days
20 15 to 30 days
1 0 to 2 days



and this in the .xls export:

days Text0to2
0 0 to 2 days
30
25
20
1 0 to 2 days


Thanks for help!!!

Kind regards
SepP
 
M

Marshall Barton

Sebastian said:
I have a report which calculates on an condition some textboxes:

Private Sub Detail_Print()

If Me.Text62 > 30 Then
'Me.Text62.Visible = False
Me.Textover30.Visible = True
Me.Text15to30.Visible = False
Me.Text2to15.Visible = False
Me.Text0to2.Visible = False
Me.Textfuture.Visible = False
ElseIf Me.Text62 <= 30 And Me.Text62 >= 15 Then
'Me.Text62.Visible = False
Me.Text15to30.Visible = True
Me.Textover30.Visible = False
Me.Text2to15.Visible = False
Me.Text0to2.Visible = False
Me.Textfuture.Visible = False

etc........

End If

As you can see I want to show some textboxes only if the condition is
true. Over this way I show for each row a number in one field is
between 0 and 2, 15 to 30 etc. I couldn't find another way.

Now, when I export this report into and EXCEL format I can see only
one colum. for example TextOver30.
All the others are not visible... and the column is named like one
textbox.

Example

This is what I get in the report and it should be in the .xls export.

days age
0 0 to 2 days
30 over 30 days
25 15 to 30 days
20 15 to 30 days
1 0 to 2 days



and this in the .xls export:

days Text0to2
0 0 to 2 days
30
25
20
1 0 to 2 days


You should not use Export/PublishWith on reports. Reports
are graphical things intende for the screen or paper.
Instead you should export a query that contain the data.

In this case, I think you can use a calculated field in the
query you used for the report's record source:

Age: Switch(days > 30,"Over 30", days > 15,"16 - 30",
days > 2,"3 - 15", True,"0 - 2")
 
S

SePp

Sebastian said:
I have a report which calculates on an condition some textboxes:
Private Sub Detail_Print()
If Me.Text62 > 30 Then
'Me.Text62.Visible = False
Me.Textover30.Visible = True
Me.Text15to30.Visible = False
Me.Text2to15.Visible = False
Me.Text0to2.Visible = False
Me.Textfuture.Visible = False
ElseIf Me.Text62 <= 30 And Me.Text62 >= 15 Then
'Me.Text62.Visible = False
Me.Text15to30.Visible = True
Me.Textover30.Visible = False
Me.Text2to15.Visible = False
Me.Text0to2.Visible = False
Me.Textfuture.Visible = False

End If
As you can see I want to show some textboxes only if the condition is
true. Over this way I show for each row a number in one field is
between 0 and 2, 15 to 30 etc. I couldn't find another way.
Now, when I export this report into and EXCEL format I can see only
one colum. for example TextOver30.
All the others are not visible... and the column is named like one
textbox.

This is what I get in the report and it should be in the .xls export.
days age
0 0 to 2 days
30 over 30 days
25 15 to 30 days
20 15 to 30 days
1 0 to 2 days
and this in the .xls export:
days Text0to2
0 0 to 2 days
30
25
20
1 0 to 2 days

You should not use Export/PublishWith on reports. Reports
are graphical things intende for the screen or paper.
Instead you should export a query that contain the data.

In this case, I think you can use a calculated field in the
query you used for the report's record source:

Age: Switch(days > 30,"Over 30", days > 15,"16 - 30",
days > 2,"3 - 15", True,"0 - 2")

--
Marsh
MVP [MS Access]- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Thank you very much Marsh, you helped a lot!!!

Greets
Sepp
 

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