LineFeed/CariageReturn in Label Text

  • Thread starter Thread starter dchendrickson
  • Start date Start date
D

dchendrickson

I am using Access2002 / XP Pro.

I am using a label on a form to pass some instructions to
the user. The contents of the label changes each time the
form opens. I send the string for the label through the
OpenArgs variable in the DoCmd.OpenForm method.

I would like the message displayed to contain a few
linefeed or cariage returns. If I hardcode the label
caption through the properties dialog box, I can use a
SHIFT + ENTER key combination and get the result I
desire. However, when I create the string in code to pass
to the form, I am not seeing the same thing. Instead of a
Cariage Return I get a square.

Can someone please guide me in the correct syntax? Or
perhaps the Label is not the proper choice of control to
use for this. Here is a sample of what I have now:

strMsg = "some text " & intMyint & "some more " _
& "text." & vbCr & "Yet some more text."

DoCmd.OpenForm "form", , , , , , strMsg

In place of the vbCr, I have also tried Chr(10) and Chr
(13).

Thank you in advance.

-dc
 
.... answered my own question. A combination of a cariage
return and line feed does the trick.

vbCr & vbLf

-dc
 
Back
Top