473,464 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Format a reports layout

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
5 1420
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
(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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Shaileen Patel | last post by:
Hi, I am trying to convert a lot of web reports from ASP/VB to ASP.NET/VB.NET. I would like to save my dataset in XML and then use XSLT to transform the XML. The catch is I would like to have...
3
by: Gary Wright | last post by:
I have a fairly large application in which the users seem to frequently want their reports changed - even if it is just the layout. What is the best way to allow users to create their own reports,...
3
by: marwa mohamed | last post by:
salamo alikom hi all when i run report that includes image control linked to a field in the table that contains the image path(on the server)and the record source of the report contains over 30...
1
by: Johnny Gee | last post by:
Hi All I have a macro that I use to send three reports every week to about 10 people by email via Lotus Notes.I use the "Send To" command to send the reports out in Rich Text Format. I used RTF...
3
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
3
by: kmacon | last post by:
I have a form that contains a command button. The command button's OnClick event builds a report using the CreateReport and CreateReportControl functions and then opens the main report. I set...
5
by: bcanavan | last post by:
When I export xml(and xls) from Access 2003 the result is a complete report in a single page. I would like to get the entire report in a single page (one trip to the server) for printing and...
0
by: CK | last post by:
There have been a few postings asking if there is an alternative to Crystal Reports for a web based web reporting solution. Access2PDF is the software solution for developers looking for an easy...
2
by: matt | last post by:
hello, i have an .RPT file that i am using to load a report via the ASP.NET CrystalReportViewer control. i dont include my .RPTs as embedded resources...instead i load the absolute path of the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.