By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,398 Members | 946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,398 IT Pros & Developers. It's quick & easy.

Format a reports layout

P: n/a
I want to print a report which displays the database items in rows.

For each entry in the database there can be up to 3 cost codes.

I have put each cost code in 3 different text boxes on my Report, one
above the other.
The problem with this is that if the are only 1 or 2 cost codes for
that entry in the database the report still shows the space on the page
where the text box would be.

What i would like to do is either:

a) Get rid of the empty textboxes so that it shuffles all the entry
together neatly.

Or

b) Display the 3 cost codes in 1 textbox and shrink/grow the box
depending on how many costcodes there are.

Please help. Also if there is an alternative method that would be much
appreciated

Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Have you tried the Can Shrink property for the textbox and report section?
It is located on the Format tab of the Properties sheet when in design mode.
If the textbox has an attached label, it will shrink also, but if you have
anything else in line horizontally with the textbox, it won't shrink because
that space will need to stay open to display the other item.

--
Wayne Morgan
MS Access MVP
<si************@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I want to print a report which displays the database items in rows.

For each entry in the database there can be up to 3 cost codes.

I have put each cost code in 3 different text boxes on my Report, one
above the other.
The problem with this is that if the are only 1 or 2 cost codes for
that entry in the database the report still shows the space on the page
where the text box would be.

What i would like to do is either:

a) Get rid of the empty textboxes so that it shuffles all the entry
together neatly.

Or

b) Display the 3 cost codes in 1 textbox and shrink/grow the box
depending on how many costcodes there are.

Please help. Also if there is an alternative method that would be much
appreciated

Nov 13 '05 #2

P: n/a
(1)Make the text boxes really short (Eg make the height .03 cm or
something) and squash them up very close together, almost on top of
each other, make Can Grow and Can Shrink YES.
(2)You could also do it in the before print event - something like
ThePrintControl = ""
If not isnull(txtBox1) then ThePrintControl = ThePrintControl & txtBox1
& vbCrLf
If not isnull(txtBox2) then ThePrintControl = ThePrintControl & txtBox2
& vbCrLf
If not isnull(txtBox3) then ThePrintControl = ThePrintControl & txtBox3
& vbCrLf
If len(ThePrintControl) > 0 then ThePrintControl =
left(ThePrintControl,len(ThePrintControl)-1)
Where txtBox1,... are invisible controls somewhere on the report

Terry Bell

Nov 13 '05 #3

P: n/a
I'm trying =[CostCode1] & Chr$(13) & Chr$(10) & [CostCode2] & Chr$(13)
& Chr$(10) & [CostCode3]

as my control source for the textbox. Inserting a carrage return
between each entry.

And i've set that to shrink and grow.

Trouble is now its gonna put all those carrige returns in even when
there is no entry.

Nov 13 '05 #4

P: n/a
Both report controls and report sections have a property CanShrink. Does
that help you enough?

si************@gmail.com wrote:
a) Get rid of the empty textboxes so that it shuffles all the entry
together neatly.

Or

b) Display the 3 cost codes in 1 textbox and shrink/grow the box
depending on how many costcodes there are.


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #5

P: n/a
Because of Null propagation you can try

[costcode1] + chr(13) + chr(10) & [costcode2] etc

+ will propagate nulls, hence hide the newline, whereas & will not.

si************@gmail.com wrote:
I'm trying =[CostCode1] & Chr$(13) & Chr$(10) & [CostCode2] & Chr$(13)
& Chr$(10) & [CostCode3]

as my control source for the textbox. Inserting a carrage return
between each entry.

And i've set that to shrink and grow.

Trouble is now its gonna put all those carrige returns in even when
there is no entry.


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.