Monday, 8 March 2010

Concatenation Madness

Concatenation of fields is when you put two or more fields together to make a single output - say for a report.

A good place to use this is if you have a persons name.

You could create the report with three separate boxes - one for the title, one for the forename and one for the surname. You'd have to make sure each box was big enough to cope with any length of name though, so you'd end up with output which looked like:

Mrs     Danielle         Bagshaw

Which works but looks  a bit naff, especially if it's supposed to be a letter heading. Wouldn't it be so much better to get:

Mrs Danielle Bagshaw
Mr Jim Chicken

...with just the right amount of spaces?

So concatenate already! The juice covered text book tells you how to do this on page 214, but it's dead easy really.
  • create an unbound text box (CAREFUL: don't make it a label! It must be a textbox. Trust me; ask Jane)
  • type in something along the lines of =[Title]&" "&[Forename]&" "&[Surname]
  • check it works

The & symbol (called an Ampersand by the way) ties the fields together into one output - which is what concatenation is. And it's a dead cool word for scrabble if someone already has cat and nation in the right place = triple word score heaven.

No comments: