 |
Access VBA Discuss using VBA for Access programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

July 18th, 2007, 05:47 AM
|
Registered User
|
|
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Bolding some record of report [Solved]
Hello,
I cannot find the correct code for turning a record line into bold based on a criteria.
Here is the code I use for changing the BackColour but there does not seem to be a specific property for changing the field's bold property.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.F_MANAGER = True Then
Me.Detail.BackColor = RGB(220, 220, 220)
Else
Me.Detail.BackColor = vbWhite
End If
End Sub
Can you please help ?
Thanks in advance,
Sven
|

July 18th, 2007, 06:49 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Here you are changing the Detail back color. You can't change the entire record to bold, you have to do it for each control in the Detail section (as far as I know.)
For example:
If Me.F_MANAGER = True Then
Me.FirstName.FontBold = True
Me.LastName.FontBold = True
...
Else
Me.FirstName.FontBold = False
Me.LastName.FontBold = False
...
End If
mmcdonal
|

July 18th, 2007, 07:54 AM
|
Registered User
|
|
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by mmcdonal
Here you are changing the Detail back color. You can't change the entire record to bold, you have to do it for each control in the Detail section (as far as I know.)
For example:
If Me.F_MANAGER = True Then
Me.FirstName.FontBold = True
Me.LastName.FontBold = True
...
Else
Me.FirstName.FontBold = False
Me.LastName.FontBold = False
...
End If
mmcdonal
|
As simple as that damit!!!
I sometimes wonder why the autosense does not offer the property in the list.
Thanks a lot mmcdonal,
Sven
|

July 18th, 2007, 07:58 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Actually, if you are typing
Me.Detail.
then you won't get a FontBold autosense, but if, for example, you are typing
Me.FirstName.
then you should get a FontBold autosense.
This is a little tedious, but works. I suppose you could do a For Each ctl etc, but that would end up taking the same amount of time. Plus you can copy and paste the control names once you do the Then section to the Else section.
mmcdonal
|

July 18th, 2007, 08:04 AM
|
Registered User
|
|
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by mmcdonal
Actually, if you are typing
Me.Detail.
then you won't get a FontBold autosense, but if, for example, you are typing
Me.FirstName.
then you should get a FontBold autosense.
This is a little tedious, but works. I suppose you could do a For Each ctl etc, but that would end up taking the same amount of time. Plus you can copy and paste the control names once you do the Then section to the Else section.
mmcdonal
|
No, not event if type Me.FirstName. I do not get the property in the list... strange.
Anyway, I just have 5 fields to turn to bold so it is not a problem to do them one by one.
|
|
 |