Carriage Return - HELPQ!!

K

KHS

I have two fields which I would like to link in my report with
carriage return: The fields are "Question" and "Answer":

i.e.
Question (Carriage Return)
Answer

I tried to name a field "Quest" and define the control source as:
=[Question] & VbCrLf & [Answer]

When I run the report it changes this field to
=[Question] & [VbCrLf] & [Answer]
Which, of course, shows this field as #Name?

Is there a better way for me to do this
 
M

Marshall Barton

KHS said:
I have two fields which I would like to link in my report with a
carriage return: The fields are "Question" and "Answer":

i.e.
Question (Carriage Return)
Answer

I tried to name a field "Quest" and define the control source as:
=[Question] & VbCrLf & [Answer]

When I run the report it changes this field to
=[Question] & [VbCrLf] & [Answer]
Which, of course, shows this field as #Name?

Is there a better way for me to do this?


vbCrLf is a VBA constant, whuch are not known outside the
VBA environment. To do this in a control source expression
or a query, you have to use the value of the constant:

=[Question] & CHr(13) & Chr(10) & [Answer]
 

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