A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Changing Text Colour within a TextBox



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2005, 04:50 PM
John Ortt
external usenet poster
 
Posts: n/a
Default Changing Text Colour within a TextBox

I have added the following code to a textbox on my form.

="Total Collected (Outstanding): " &
Format(Sum([TotalReceipts]),"£#,##0.00") & " (" &
Format((Count([Surname])*200)-Sum([TotalReceipts]),"£#,##0.00") & ")"

If possible I would like to have two colours within the text box, White for
"Collected" and Red for "Outstanding".

I realise I could do this with separate text boxes but I would prefer the
precise alignment of using a single box if possible.

If not I'll have to rethink...

Thanks in Advance,

John





  #2  
Old May 25th, 2005, 07:18 PM
Stephen Lebans
external usenet poster
 
Posts: n/a
Default

You will have to rethink your requirements as the standard Access
TextBox control does not support individual character formatting.
You would have to use a Rich Text(RTF) ActiveX control. On top of this
you would have to programmatically build the required RTF encoding at
runtime. If you are comfortable with String manipulations then it si not
too difficult.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"John Ortt" wrote in
message ...
I have added the following code to a textbox on my form.

="Total Collected (Outstanding): " &
Format(Sum([TotalReceipts]),"£#,##0.00") & " (" &
Format((Count([Surname])*200)-Sum([TotalReceipts]),"£#,##0.00") & ")"

If possible I would like to have two colours within the text box,

White for
"Collected" and Red for "Outstanding".

I realise I could do this with separate text boxes but I would prefer

the
precise alignment of using a single box if possible.

If not I'll have to rethink...

Thanks in Advance,

John






  #3  
Old May 26th, 2005, 10:14 AM
John Ortt
external usenet poster
 
Posts: n/a
Default


"Stephen Lebans"
wrote in message ...
You will have to rethink your requirements as the standard Access
TextBox control does not support individual character formatting.


Oh well, thanks for letting me know Stephen.

You would have to use a Rich Text(RTF) ActiveX control. On top of this
you would have to programmatically build the required RTF encoding at
runtime. If you are comfortable with String manipulations then it si not
too difficult.


This sounds good but I could not find the Rich Text ActiveX control in the
"More Controls" section on access.
Could it have another name or could I need to install a new add-in in order
to find it?

Thanks again for the help,

John


  #4  
Old May 26th, 2005, 08:06 PM
Stephen Lebans
external usenet poster
 
Posts: n/a
Default

See:
http://www.lebans.com/richtext.htm
RTF2 control is an ActiveX RTF solution written in VC++. The RTF2
control is a complete editing/printing solution for Access 97 or higher.
Autosizing of the RTF2 control is supported for A2K or higher. This is a
full automatic install package. This install package contains 3 required
files for the control to function. The OCX itself, RTF2.OCX and the 2 VC
runtime files, Mfc42.Dll and Msvcrt.Dll. AFAIK the two VC runtime files
will already exist on all installs of Windows
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"John Ortt" wrote in
message ...

"Stephen Lebans"


wrote in message ...
You will have to rethink your requirements as the standard Access
TextBox control does not support individual character formatting.


Oh well, thanks for letting me know Stephen.

You would have to use a Rich Text(RTF) ActiveX control. On top of

this
you would have to programmatically build the required RTF encoding

at
runtime. If you are comfortable with String manipulations then it si

not
too difficult.


This sounds good but I could not find the Rich Text ActiveX control in

the
"More Controls" section on access.
Could it have another name or could I need to install a new add-in in

order
to find it?

Thanks again for the help,

John



  #5  
Old May 27th, 2005, 09:11 AM
John Ortt
external usenet poster
 
Posts: n/a
Default


"Stephen Lebans"
wrote in message ...
See:
http://www.lebans.com/richtext.htm


snip

Excellent, Thanks Stephen.


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box (1st) Populating Text Box (2nd) Field AccessRookie Using Forms 1 April 6th, 2005 11:37 PM
Combo Box & Text Box AccessRookie Using Forms 3 April 6th, 2005 11:33 PM
Help with design Ronnie Database Design 6 March 12th, 2005 02:53 PM
Access reports with a horizontal line after each record??? Bill via AccessMonster.com Setting Up & Running Reports 6 March 9th, 2005 04:51 PM
textbox to normal text Jack Sons New Users 16 December 5th, 2004 03:44 PM


All times are GMT +1. The time now is 09:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.