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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
"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
|
|||
|
|||
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
|
|||
|
|||
"Stephen Lebans" wrote in message ... See: http://www.lebans.com/richtext.htm snip Excellent, Thanks Stephen. |
Thread Tools | |
Display Modes | |
|
|
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 |