blank lines in the address block

D

David French

I know when I'm using Word for a Mail Merge that it is possible to have both
fields NOT print if there is no data in them.
For instance the database has Address1 and Address2. If one record DOES
have both then a '4 line' address will result.
If another record DOES NOT have data in Address2 then not only is there no
data but the address block will be reduced to '3 lines' making a more
aesthetically pleasing look.

Due to the nature of this particular project I need to have this particular
letter set up as an Access report for the grouping of records on the
Customer Number.

Does Access have any functionality that will allow for the 3 line - 4 line
difference without resorting (as I already have) to creating separate
reports. One report has BOTH Address1 AND Address2 and the other only has
Address1.

Windows XP
Office 2002 AND Office 2003


Dave French
 
A

Allen Browne

Set the Can Shrink property of your text boxes to Yes.

Unless there is something else that overlaps the control vertically, it will
effectively become zero-height when null.
 
J

Jeff Boyce

David

Take a look at the CanGrow/CanShrink properties, both of the [Address]
controls AND the Detail section of the report definition.
 
D

David French

OK....
I tried that setting both boxes properties to "Can Shrink".
Now how is the text box underneath supposed to move UP to take up the space?
Or, do I make one box that has both items in it.
For instance Address1 & Address2.

If one or the other is null then the space would be reduced, correct?

Now that I've said that....how would I get Address1 and Address2 to reside
on 2 separate lines in that case?

Dave French
 
A

Allen Browne

Try it, David.

Or use the Report Wizard for Labels to get Access to create an example for
you.
 
D

David French

How do you force a line return inside a text box?
I have tried a simple press of the Enter button but that only ends my
editing.
I have tried a ^p and a ^l to no avail.
The Report Wizard was no help either.

Any other suggestions?

Dave French
 
G

Guest

Hi David,
In the Other section of the text box properties there is a property called
"Enter Key Behavior." Change it to "New Line in Field."

Cheers.
 
A

Allen Browne

For this case, you are probably better off using separate text boxes, so
they Can Shrink. It can get more messy where you are combining several
fields with optional line breaks.

If you want to do it anyway, you need to add a Carriage Return and Line
Feed:
=[Address1] & Chr(13) & Chr(10) & [Address2]
 
D

David French

I'm really not seeing any of this working at ALL.
I have tried all of these suggestions (not the <CR> or <LR> yet) but I don't
see how the shrinking is helping at all.
I still end up with a space where I don't WANT a space.

I hope this works out on here as far as attempting to visually describe what
I'm seeing.

Dave French
123 Somewhere Street
Suite 99
Anywhere, NY 12345

Now...even if I tell the text box that contains the "Suite 99" to shrink I
still end up with:

Dave French
123 Somewhere Street

Anywhere, NY 12345

OK...the box shrank....but the City, ST ZIP box has no instruction to move
UP.

Still Confused,
Dave




Allen Browne said:
For this case, you are probably better off using separate text boxes, so
they Can Shrink. It can get more messy where you are combining several
fields with optional line breaks.

If you want to do it anyway, you need to add a Carriage Return and Line
Feed:
=[Address1] & Chr(13) & Chr(10) & [Address2]

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

David French said:
How do you force a line return inside a text box?
I have tried a simple press of the Enter button but that only ends my
editing.
I have tried a ^p and a ^l to no avail.
The Report Wizard was no help either.

Any other suggestions?

Dave French
 
A

Allen Browne

It does work, David.

To see an example, open the Northwind sample database, and run the Customer
Labels report. The report shows address boxes shinking and growing according
to the data in the Customers table.

You can delete everything in the Address field for customer:
Cactus Comidas para llevar
to see the "Buenos Aires 1010" move right up under the customer name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

David French said:
I'm really not seeing any of this working at ALL.
I have tried all of these suggestions (not the <CR> or <LR> yet) but I
don't see how the shrinking is helping at all.
I still end up with a space where I don't WANT a space.

I hope this works out on here as far as attempting to visually describe
what I'm seeing.

Dave French
123 Somewhere Street
Suite 99
Anywhere, NY 12345

Now...even if I tell the text box that contains the "Suite 99" to shrink I
still end up with:

Dave French
123 Somewhere Street

Anywhere, NY 12345

OK...the box shrank....but the City, ST ZIP box has no instruction to move
UP.

Still Confused,
Dave




Allen Browne said:
For this case, you are probably better off using separate text boxes, so
they Can Shrink. It can get more messy where you are combining several
fields with optional line breaks.

If you want to do it anyway, you need to add a Carriage Return and Line
Feed:
=[Address1] & Chr(13) & Chr(10) & [Address2]

David French said:
How do you force a line return inside a text box?
I have tried a simple press of the Enter button but that only ends my
editing.
I have tried a ^p and a ^l to no avail.
The Report Wizard was no help either.

Any other suggestions?

Dave French


Try it, David.

Or use the Report Wizard for Labels to get Access to create an example
for you.


OK....
I tried that setting both boxes properties to "Can Shrink".
Now how is the text box underneath supposed to move UP to take up the
space?
Or, do I make one box that has both items in it.
For instance Address1 & Address2.

If one or the other is null then the space would be reduced, correct?

Now that I've said that....how would I get Address1 and Address2 to
reside on 2 separate lines in that case?

Dave French

Set the Can Shrink property of your text boxes to Yes.

Unless there is something else that overlaps the control vertically,
it will effectively become zero-height when null.

I know when I'm using Word for a Mail Merge that it is possible to
have both fields NOT print if there is no data in them.
For instance the database has Address1 and Address2. If one record
DOES have both then a '4 line' address will result.
If another record DOES NOT have data in Address2 then not only is
there no data but the address block will be reduced to '3 lines'
making a more aesthetically pleasing look.

Due to the nature of this particular project I need to have this
particular letter set up as an Access report for the grouping of
records on the Customer Number.

Does Access have any functionality that will allow for the 3 line -
4 line difference without resorting (as I already have) to creating
separate reports. One report has BOTH Address1 AND Address2 and the
other only has Address1.

Windows XP
Office 2002 AND Office 2003
 
D

David French

Well Allen,
I have compared everything from 'soup to nuts' between both databases.
The only thing that has worked at ALL is to copy the fields from the
Northwind sample report and paste them into MY report and then changing the
field names in the text boxes. This HAS finally worked although I don't see
what parameter I missed.
Copy and paste is easier anyway.
Don't argue with SUCCESS!!

Thank you for your help!

Dave French



Allen Browne said:
It does work, David.

To see an example, open the Northwind sample database, and run the
Customer Labels report. The report shows address boxes shinking and
growing according to the data in the Customers table.

You can delete everything in the Address field for customer:
Cactus Comidas para llevar
to see the "Buenos Aires 1010" move right up under the customer name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

David French said:
I'm really not seeing any of this working at ALL.
I have tried all of these suggestions (not the <CR> or <LR> yet) but I
don't see how the shrinking is helping at all.
I still end up with a space where I don't WANT a space.

I hope this works out on here as far as attempting to visually describe
what I'm seeing.

Dave French
123 Somewhere Street
Suite 99
Anywhere, NY 12345

Now...even if I tell the text box that contains the "Suite 99" to shrink
I still end up with:

Dave French
123 Somewhere Street

Anywhere, NY 12345

OK...the box shrank....but the City, ST ZIP box has no instruction to
move UP.

Still Confused,
Dave




Allen Browne said:
For this case, you are probably better off using separate text boxes, so
they Can Shrink. It can get more messy where you are combining several
fields with optional line breaks.

If you want to do it anyway, you need to add a Carriage Return and Line
Feed:
=[Address1] & Chr(13) & Chr(10) & [Address2]

How do you force a line return inside a text box?
I have tried a simple press of the Enter button but that only ends my
editing.
I have tried a ^p and a ^l to no avail.
The Report Wizard was no help either.

Any other suggestions?

Dave French


Try it, David.

Or use the Report Wizard for Labels to get Access to create an example
for you.


OK....
I tried that setting both boxes properties to "Can Shrink".
Now how is the text box underneath supposed to move UP to take up the
space?
Or, do I make one box that has both items in it.
For instance Address1 & Address2.

If one or the other is null then the space would be reduced, correct?

Now that I've said that....how would I get Address1 and Address2 to
reside on 2 separate lines in that case?

Dave French

Set the Can Shrink property of your text boxes to Yes.

Unless there is something else that overlaps the control vertically,
it will effectively become zero-height when null.

I know when I'm using Word for a Mail Merge that it is possible to
have both fields NOT print if there is no data in them.
For instance the database has Address1 and Address2. If one record
DOES have both then a '4 line' address will result.
If another record DOES NOT have data in Address2 then not only is
there no data but the address block will be reduced to '3 lines'
making a more aesthetically pleasing look.

Due to the nature of this particular project I need to have this
particular letter set up as an Access report for the grouping of
records on the Customer Number.

Does Access have any functionality that will allow for the 3 line -
4 line difference without resorting (as I already have) to creating
separate reports. One report has BOTH Address1 AND Address2 and
the other only has Address1.

Windows XP
Office 2002 AND Office 2003
 

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