Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 465
  • Last Modified:

Format text in a label MS Access

Hello.  It actually doesn't have to be a label. Any control you suggest will do as long as it accomplishes what I'm looking for.

Currently, I have a label on an Access form with a bunch of text in it. The text is actually a series of instructions for the user. Right now, it's all one long string. I'm trying to format it so that the instructions are separated by a couple of lines but can't get it to work. I realize I could put each instruction in a separate label but I'm trying to find out if it can be done all in one control.

Right now, the data in the lable looks something like this:

Instruction 1: Do this that and the other thing. Instruction 2: Do this that and the other thing. Instruction 3: Do this that and the other thing.

I want it to look more like something like this:

Instruction 1: Do this that and the other thing.

Instruction 2: Do this that and the other thing.

Instruction 3: Do this that and the other thing.

Thank you.
0
dbfromnewjersey
Asked:
dbfromnewjersey
  • 3
2 Solutions
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
This should do it:

Me.YourLabel.Caption = "Instruction 1: Do this that and the other thing." & Chr(13) & CHr(10 & "
Instruction 2: Do this that and the other thing. "  & Chr(13) & CHr(10 & "Instruction 3: Do this that and the other thing."
0
 
mbizupCommented:
Are you looking for something automated?

Me.lblyourLabel.caption = replace (me.lblYourLabel.caption, ".", "." & vbcrlf)
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I left out a couple of parens:


Me.YourLabel.Caption = "Instruction 1: Do this that and the other thing." & Chr(13) & Chr(10) & "
"Instruction 2: Do this that and the other thing."  & Chr(13) & Chr(10) & "Instruction 3: Do this that and the other thing."
0
 
dbfromnewjerseyAuthor Commented:
Oh ok I see. So instead of typing the text directly into the label like I did, type the text into the code window. Got it. Thanks!
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Just curious, which solution did you use ?

Also, you don't have to use code.  If, on the Property sheet for the Label, click into the Caption property. Then, hit Shift F2 to open the Zoom window (optional).  Then, type first line, then Control+J on the keyboard, then the next line, then Control+J and next line and so on.  This will insert a Carriage Return/Line Feed after each line.  (You won't need the double quotes).

mx
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now