Conditional filling of field problem

  • Thread starter prairiewind via AccessMonster.com
  • Start date
P

prairiewind via AccessMonster.com

I'm using Access 2007.

The following code is in the unbound text box on the second line of the
detail section in a report:

=IIf(IsNull([FullAddress1]),"",(IIf(([LNFNCLen]<[NameLineLength]),"",IIf
(IsNull([Children]),"",[Children])))) & (IIf(([LNFNCEAILen]<[NameLineLength]),
[FullAddress1],IIf(IsNull([ExtraAddressInformation]),""," " &
[ExtraAddressInformation])))

LNFNCLen is the length of the LastName, FirstName and Children fields.
LNFNCEAILen is the length of the LastName, FirstName, Children &
ExtraAddressInformation fields
NameLineLength is a number that controls the width of field which gives the
customer can change.

This code has worked fine until recently a customer entered more children in
the Children field causing the text box to grow and cause the text boxes next
to it to skip a line. As a result, in the query that the report is based off
of, I've added expressions that split the children into two fields
(SplitChildrenLeft and SplitChildrenRight).

What I'm wanting is if the Children field is too long (greater than
NameLineLength), then on the first line of the report is to print the
LastName, FirstName and then SplitChildrenLeft. On the second line, if the
Children field is too long, to print SplitChildrenRight, else to use the code
above. However, I've been trying for quite a while now and I can't seem to
get the coding right. Any suggestions or ideas would be appreciated.
 

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