Forcing font to Italic?

B

Bob V

How close am I to it? Trying to get the font to turn to Italic when
flagged........Thanks for any help.....Bob
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If FormatCount = 1 Then
If Me.tbFlag = -1 Then
Me.tbInvoiceDate.Font = Italic
Me.tbInvoiceDescription.Font = Italic
Me.tbInvoiceID.Font = Italic
Me.tbInvoiceAmount.Font = Italic
Else
Me.tbInvoiceDate.Font = Normal
Me.tbInvoiceDescription.Font = Normal
Me.tbInvoiceID.Font = Normal
Me.tbInvoiceAmount.Font = Normal
End If
End If
End Sub
 
K

Ken Snell \(MVP\)

Close....

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If FormatCount = 1 Then
If Me.tbFlag = -1 Then
Me.tbInvoiceDate.FontItalic = True
Me.tbInvoiceDescription.FontItalic = True
Me.tbInvoiceID.FontItalic = True
Me.tbInvoiceAmount.FontItalic = True
Else
Me.tbInvoiceDate.FontItalic = False
Me.tbInvoiceDescription.FontItalic = False
Me.tbInvoiceID.FontItalic = False
Me.tbInvoiceAmount.FontItalic = False
End If
End If
End Sub

And here is a shorter way to do it:


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If FormatCount = 1 Then
Me.tbInvoiceDate.FontItalic = Me.tbFlag
Me.tbInvoiceDescription.FontItalic = Me.tbFlag
Me.tbInvoiceID.FontItalic = Me.tbFlag
Me.tbInvoiceAmount.FontItalic = Me.tbFlag
End If
End Sub
 
B

Bob V

Thanks Ken, Good to know I was Close :\
Can I add this in as well:
If FormatCount = 1 Then
Me.tbInvoiceDate.FontColor Grey = Me.tbFlag
Me.tbInvoiceDescription.FontColor Grey = Me.tbFlag
Me.tbInvoiceID.FontColor Grey= Me.tbFlag
Me.tbInvoiceAmount.FontColor Grey = Me.tbFlag
End If
Thanks for your help ...........Bob
 
B

Bob V

Thanks Ken got it
If tbFlag = -1 Then
tbInvoiceDescription.ForeColor = 255
Else: tbInvoiceDescription.ForeColor = 0
End If
 

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