Subscript Value in Label Box

K

Karl

Hello,

I was wondering if it possible to subsript a letter in a label box on a
report. I.e H20. I would like to subscript the 2.

Thanks,
Karl
 
D

Duane Hookom

This might be doable with some code. Assuming the name of the label is
"lblH2O" and the caption is "H2O" and the label is invisible. Add code to
the On Format event of the section like:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.CurrentX = Me.lblH2O.Left
Me.CurrentY = Me.lblH2O.Top
Me.FontSize = Me.lblH2O.FontSize
Me.Print Left(Me.lblH2O.Caption, 1)
Me.FontSize = Me.lblH2O.FontSize * 0.5
'change the 100 to meet your requirements
Me.CurrentY = Me.lblH2O.Top + 100
Me.Print Mid(Me.lblH2O.Caption, 2, 1)
Me.CurrentY = Me.lblH2O.Top
Me.FontSize = Me.lblH2O.FontSize
Me.Print Right(Me.lblH2O.Caption, 1)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top