Blank field behaviour in forms

B

Bernie

I have been trying to create an invoice as an Access form.

The name and address is on the top left of the form, and
looks something like this:

Mr. B. Bloggs
Mrs. K. Bloggs
20 Dodgy Lodge
Long Road
Southend
Essex DDT 8XB

However, not all addresses have two people and use all
the address fields. When I first used this it worked
well, the first line of the address moved up to fill the
space of the second person when there was only one
person. The address also went up to fill any blank lines.

But then I put some required text and fields on the right
hand side of the invoice, adjacent the address, and now
the address does not hide the blank lines and looks messy!

Any sugestions on how I can get rid of the blank lines
again?

Thanks,
Bernie.
 
P

Pavel Romashkin

I think the simplest way to do what you want is to concatinate all text
fields into one string and then put it into the text field:

LastName1 + vbCRLF & LastName2 + vbCRLF & StreetAddress + vbCRLF &
StreetName + vbCRLF & CityName & PostalCode

Whenever you use "+" to add pieces together, if one of the arguments is
null, the result is null, too, so you will not get several line breaks
in the text box.
Good luck,
Pavel
 
B

Bernie

Thanks Pavel,
I'll have a go.

Bernie
-----Original Message-----
I think the simplest way to do what you want is to concatinate all text
fields into one string and then put it into the text field:

LastName1 + vbCRLF & LastName2 + vbCRLF & StreetAddress + vbCRLF &
StreetName + vbCRLF & CityName & PostalCode

Whenever you use "+" to add pieces together, if one of the arguments is
null, the result is null, too, so you will not get several line breaks
in the text box.
Good luck,
Pavel

.
 

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