PC Review


Reply
Thread Tools Rate Thread

Character Codes

 
 
Tim
Guest
Posts: n/a
 
      1st Aug 2003
Hello,

I am trying to dynamically change the labels on a group
of buttons on a form. It is a calendar with event
descriptions on a button for each day. I have the code all
set up, but I want to use three lines of text on each
button. I have used Chr(13) to do a carriage return. All
that gives me is the filled in block that represents a
return though, not an actual new line. It does the same
with the linefeed character Chr(10). If I type directly
into the button and hit Control-Return it will put a true
carriage return in the text (I used the ASC() function to
verify that it is Chr(13)). Is there some way to insert a
carriage return through VBA code? Thanks

Tim
 
Reply With Quote
 
 
 
 
Bruce M. Thompson
Guest
Posts: n/a
 
      1st Aug 2003
> I am trying to dynamically change the labels on a group
> of buttons on a form. It is a calendar with event
> descriptions on a button for each day. I have the code all
> set up, but I want to use three lines of text on each
> button. I have used Chr(13) to do a carriage return. All
> that gives me is the filled in block that represents a
> return though, not an actual new line. It does the same
> with the linefeed character Chr(10). If I type directly
> into the button and hit Control-Return it will put a true
> carriage return in the text (I used the ASC() function to
> verify that it is Chr(13)). Is there some way to insert a
> carriage return through VBA code? Thanks


You need to use both Chr(13) and Chr(10), and in that order, or one of the
intrinisc constants, such as vbNewLine or vbCrLf (the constants can only be used
from within VBA):

Me.lblText.Caption = "This is line 1 and" & _
Chr(13) & Chr(10) & "this is line 2."

.... or ...

Me.lblText.Caption = "This is line 1 and" & _
vbCrLf & "this is line 2."

.... or ...

Me.lblText.Caption = "This is line 1 and" & _
vbNewLine & "this is line 2."

--
Bruce M. Thompson, Microsoft Access MVP
(E-Mail Removed) (See the Access FAQ at http://www.mvps.org/access)
>> NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<


 
Reply With Quote
 
Tim
Guest
Posts: n/a
 
      1st Aug 2003

Thanks for the help!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: old vs new character codes Tyro Windows Vista General Discussion 1 6th Jan 2009 09:46 PM
Re: old vs new character codes Carey Frisch Windows Vista General Discussion 1 6th Jan 2009 06:32 PM
Character codes Jim Pockmire Microsoft Access VBA Modules 1 5th Nov 2005 04:15 PM
Re: List of Character Codes (ALT + numeric keypad = character) Rob Schneider Microsoft Word Document Management 0 10th Sep 2003 04:35 PM
List of Character Codes (ALT + numeric keypad = character) Joe Johnson Microsoft Word Document Management 0 10th Sep 2003 04:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:07 AM.