Bold a textbox in onPrint event...

  • Thread starter Thread starter Rick's News
  • Start date Start date
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
 
Rick,
Why not just use the control's FontBold property?

In the Detail Format event, either ....
[TextBox].FontBold = True
or
[TextBox].FontBold = False
 
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
 
Back
Top