Bold a textbox in onPrint event...

R

Rick's News

What is the proper syntax to bold a textfield in VBA?

is it:
[textbox].FontWeight = Bold
[textbox].FontWeight = Normal

Also, is this the best way to code this or is there a more efficient way:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If [CorrectAnswer] = "A" Then
AnswerA.ForeColor = "255"
Label10.ForeColor = "255"
Else:
AnswerA.ForeColor = "0"
Label10.ForeColor = "0"
End If

If [CorrectAnswer] = "B" Then
AnswerB.ForeColor = "255"
Label11.ForeColor = "255"
Else:
AnswerB.ForeColor = "0"
Label11.ForeColor = "0"
End If

If [CorrectAnswer] = "C" Then
AnswerC.ForeColor = "255"
Label12.ForeColor = "255"
Else:
AnswerC.ForeColor = "0"
Label12.ForeColor = "0"
End If

If [CorrectAnswer] = "D" Then
AnswerD.ForeColor = "255"
Label13.ForeColor = "255"
Else:
AnswerD.ForeColor = "0"
Label13.ForeColor = "0"
End If
End Sub

Please help...
I know this is an easy one...
Thanks for your time...

-Rick
 
F

Fredg

Rick,
Why not just use the control's FontBold property?

In the Detail Format event, either ....
[TextBox].FontBold = True
or
[TextBox].FontBold = False
 
R

Rick's News

Worked great thanks!!!


Fredg said:
Rick,
Why not just use the control's FontBold property?

In the Detail Format event, either ....
[TextBox].FontBold = True
or
[TextBox].FontBold = False

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Rick's News said:
What is the proper syntax to bold a textfield in VBA?

is it:
[textbox].FontWeight = Bold
[textbox].FontWeight = Normal

Also, is this the best way to code this or is there a more efficient way:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If [CorrectAnswer] = "A" Then
AnswerA.ForeColor = "255"
Label10.ForeColor = "255"
Else:
AnswerA.ForeColor = "0"
Label10.ForeColor = "0"
End If

If [CorrectAnswer] = "B" Then
AnswerB.ForeColor = "255"
Label11.ForeColor = "255"
Else:
AnswerB.ForeColor = "0"
Label11.ForeColor = "0"
End If

If [CorrectAnswer] = "C" Then
AnswerC.ForeColor = "255"
Label12.ForeColor = "255"
Else:
AnswerC.ForeColor = "0"
Label12.ForeColor = "0"
End If

If [CorrectAnswer] = "D" Then
AnswerD.ForeColor = "255"
Label13.ForeColor = "255"
Else:
AnswerD.ForeColor = "0"
Label13.ForeColor = "0"
End If
End Sub

Please help...
I know this is an easy one...
Thanks for your time...

-Rick
 

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