formatting a report with "Can Shrink"


A

anonymous

I'm new to this.

I am trying to create an address book for employees using
Access 97.

It has a simple layout (eg: Name: Location: Address:,
etc..)
the information comes from Textboxes with Labels.

i have the main part set up simply, and columnar, because
I like the "can shrink" option to keep the report small.
(eg.:
_________________________
Name: John Doe
Location: out of town
Address: Deer Lane
_________________________
etc,)

My problem is that if a field is left blank it still shows.

Here is what I don't want it to look like:
_________________________
Name: John Doe
Location:
Address: Deer Lane
_________________________
Name: Jane Smith
Location: Somewhere
Address:
_________________________

Here is what I want it to look like:
_________________________
Name: John Doe
Address: Deer Lane
_________________________
Name: Jane Smith
Location: Somewhere
_________________________

Is there a way to shrink BOTH the 'Label AND the Text' if
the field returns a NULL value?
IF there is a way, how do I do it in Access 97?

Any Help / Suggestions will be greatly appreciated.
 
Ad

Advertisements

E

Evi

I left the labels out of my address book and coloured the fields with a
colour key in the report header (eg to tell me which is the home phone and
which the work phone)

Remember not only to make the Section Can Grow/Shrink but also the text
boxes.

But if you want the labels then use the OnFormat event to make the label and
report invisible. Look at BR's reply in the thread 'Blank Space in Access
Reports for the very neatest solution and write back if you can't make head
or tail of what to do.

Evi
 
Ad

Advertisements

M

Marshall Barton

anonymous said:
I am trying to create an address book for employees using
Access 97.

It has a simple layout (eg: Name: Location: Address:,
etc..)
the information comes from Textboxes with Labels.

i have the main part set up simply, and columnar, because
I like the "can shrink" option to keep the report small.
(eg.:
_________________________
Name: John Doe
Location: out of town
Address: Deer Lane
_________________________
etc,)

My problem is that if a field is left blank it still shows.

Here is what I don't want it to look like:
_________________________
Name: John Doe
Location:
Address: Deer Lane
_________________________
Name: Jane Smith
Location: Somewhere
Address:
_________________________

Here is what I want it to look like:
_________________________
Name: John Doe
Address: Deer Lane
_________________________
Name: Jane Smith
Location: Somewhere
_________________________

Is there a way to shrink BOTH the 'Label AND the Text' if
the field returns a NULL value?
IF there is a way, how do I do it in Access 97?


There are quite a few ways to deal with this. One is to use
a text box without any label. Set the text box to an
expression like ="label text " + fieldname. But you can't
get the field values to line up with this. And there is
always the issue that the text box name has to be checked to
make sure it is not the same as the fieldname.

Another way is to use another text box instead of the label.
In this case, set the text box to this kind of expression:
=IIf(IsNull(fieldname), "", "label text")

Personally I prefer to use code in the Format event to make
the text box invisible. When the text box is invisible, its
attached label also becomes invisible. The code would be:
Me.txtfieldname.Visible = Not IsNull(Me.txtfieldname)

If the label is not atttached to the text box, then the code
would be:
Me.label.Visible = Not IsNull(Me.txtfieldname)
 

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

Similar Threads


Top