Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to apply formatting to text in rich text box.

Status
Not open for further replies.

jwhalen29

Programmer
Mar 12, 2002
15
US
I have added a rich text control (bound to a memo field) to an Access 2003 form, but I can't figure out how to actually apply any formatting. When I select text within the rich text box, the formatting buttons on the toolbar, such as bold and underline, are disabled.
 
This is in access97 so it may not work for you. Add a common dialog box to your form. Create a command button. Add the following code to that button:

With Me.commondialog1
.DialogTitle = "font"
.FontName = "arial"
.Flags = cdlCFEffects Or cdlCFBoth
.ShowFont
End With
With Me.ActiveXctl41
.SelFontName = Me.commondialog1.FontName
.SelFontSize = Me.commondialog1.FontSize
.SelItalic = Me.commondialog1.FontItalic
.SelBold = Me.commondialog1.FontBold
.SelUnderline = Me.commondialog1.FontUnderline
.SelColor = Me.commondialog1.Color
End With

The common dialog box was called commondialog1. The Rich Text Box was called ActiveXct141.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top