vbCrLf error

M

Mark J Kubicki

I've got this line of code as the data source for a report field which works
well till I add in the vbCrLf expression
this causes an: "enter parameter value... vbCrLf..."

=[FullDescription] &
IIf(DLookUp("[InclLocations]","tblFixtureSchedulePrintOptions"),([vbCrLf]+"Location:
"+[Location]),"")

any suggestions (and thanks in advance),
mark
 
F

fredg

I've got this line of code as the data source for a report field which works
well till I add in the vbCrLf expression
this causes an: "enter parameter value... vbCrLf..."

=[FullDescription] &
IIf(DLookUp("[InclLocations]","tblFixtureSchedulePrintOptions"),([vbCrLf]+"Location:
"+[Location]),"")

any suggestions (and thanks in advance),
mark

You can only use a vb constant if your expression is written in a vb
code.
If the above expression is written as a control's control source, you
cannot use a vb constant (vbCrLf).
Further, you enclosed it within brackets i.e. [vbCrLf], so Access
might consider it a field name that it cannot find and therefore is
asking for a value.

Use chr(13) & chr(10) in place of vbCrLf (without the brackets above).
 
D

Duane Hookom

You can only use vbCrLf in a module. In a control source or query, use:
=[FullDescription] &
IIf(DLookUp("[InclLocations]","tblFixtureSchedulePrintOptions"),(Chr(13) &
Chr(10)+"Location:
"+[Location]),"")
 

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