Trouble with chr(13) & chr(10) in IIF statement

C

Chuck W

I am trying insert a carriage return and line feed into a Access 2000 report
text box using the following code:

=IIf([Plant] Like "*service*","DO NOT USE RED BINS" & Chr(13) & Chr(10) &
"MUST BE VERIFIED BY QC",IIf([Plant]="Germany","MUST BE VERIFIED BY QC",""))

It seems to work in 2003, but my user is working in 2000, and every time I
try to generate the report it asks for a parameter value for Chr.

Any help would be greatly appreciated.
 
A

Allen Browne

Chr() is a built-in VBA function, so any version of Access should be able to
understand it (assuming you are running the query in Access.)

If it complains, there is probably a problem with the library references.
Details in:
http://allenbrowne.com/ser-38.html
 
K

Klatuu

Rather than making function calls to Chr(), I recommend using one of two VBA
constants. Both vbNewLine and vbCrLf are contstants that equate to Chr(13) &
Chr(10)
 
C

Chuck W

I should have specified that I'm working in expression builder so I don't
think those constants will work. They didn't when I tried them anyway.

I will see if it's a problem with the references. Thank you both for your
responses.


Klatuu said:
Rather than making function calls to Chr(), I recommend using one of two VBA
constants. Both vbNewLine and vbCrLf are contstants that equate to Chr(13) &
Chr(10)

--
Dave Hargis, Microsoft Access MVP


Chuck W said:
I am trying insert a carriage return and line feed into a Access 2000 report
text box using the following code:

=IIf([Plant] Like "*service*","DO NOT USE RED BINS" & Chr(13) & Chr(10) &
"MUST BE VERIFIED BY QC",IIf([Plant]="Germany","MUST BE VERIFIED BY QC",""))

It seems to work in 2003, but my user is working in 2000, and every time I
try to generate the report it asks for a parameter value for Chr.

Any help would be greatly 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