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

  • Thread starter Thread starter Chuck W
  • Start date Start date
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.
 
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
 
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)
 
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.
 
Back
Top