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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two font sizes within one report field ?

Status
Not open for further replies.

bjgolden80

Programmer
Feb 6, 2003
15
US
Is it possible to use two different font sizes within one report field ?

thanks.
 
No.

You would need to find a rich text control to use instead of the textbox.
 
Thanks for your help....is this only available in Access XP SP 4 ?? I cant seem to get the MS Richtext control to work in SP3...even though the object exists...
 
If this is a simple need, you might be able to use something like the following. I have a text box on a report named txtFullName which has a control source of
=[FirstName] & " " & [LastName]
I want the first name to be printed with a different size (and color) than the last name.

Make the txtFullName invisible and set its Can Shrink to No. Then add code to the On Format of the detail section:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim strFirst As String
    Dim strLast As String
    Dim intLeft As Integer
    Dim intTop As Integer
    strFirst = Left(Me.txtFullName, InStr(Me.txtFullName, " ") - 1)
    strLast = Mid(Me.txtFullName, InStr(Me.txtFullName, " ") + 1)
    Me.CurrentX = Me.txtFullName.Left
    Me.CurrentY = Me.txtFullName.Top
    Me.ForeColor = vbRed
    Me.FontSize = 8
    Me.Print strFirst & " "
    Me.ForeColor = vbGreen
    Me.FontSize = 12
    Me.CurrentY = Me.txtFullName.Top
    Me.Print strLast
End Sub
[red]John[/red] [green]Smith[/green]

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Lupins--very cool. I just got the RTF control from lebans and it's awesome.

bjgolden--did you find it? Or have you figured out another way to solve your issue?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top