Solved

turn off text wrap on a label

Posted on 2008-10-10
8
407 Views
Last Modified: 2013-11-28
I have a label where the caption is populated when the form is opened.  Is it possible to turn off of the text wrap on the label?

example:

If the label was the width of 8 letters and I was going to put the caption as "Hello World"

Only "Hello Wo" would be displayed.
0
Comment
Question by:ClaudeWalker
  • 4
  • 3
8 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 22690963
Have you tried sizing the label vertically so that it will only show one line?

This seems to work for me.
0
 

Author Comment

by:ClaudeWalker
ID: 22691129
The problem is that I have carriage returns in the caption.  
0
 

Author Comment

by:ClaudeWalker
ID: 22691131
It is the size of 3 lines worth of text.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 75
ID: 22691329
"If the label was the width of 8 letters"

Of course, that is determined by the Font being used.

"The problem is that I have carriage returns in the caption.  "

Is that good or bad?  

So, you are saying that you would want "Hello World" to appear as "Hello Wo" ?

Not quite sure what you need ?

You could limit the length of the caption in code - would that work?

mx
0
 

Author Comment

by:ClaudeWalker
ID: 22691341


That would definitely work.


0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 22691369
Here is the general idea - don't know what you have for code so far ?

PRivate Sub Form_Open(Cancel As Integer)

 '  some code

Dim sMyCaption
sMyCaption = "Hello World"

If Len(myCaption)> 8 Then myCaption = Left(myCaption,8)   ' This is the main thing here

' More code

End Sub

mx
0
 
LVL 75
ID: 22691372
Also ... do you need to get rid of carriage returns ?

mx
0
 

Author Comment

by:ClaudeWalker
ID: 22691501
That makes sense.  

No the carriage returns need to be there.

Thanks for your help,

JOe K.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question