Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 18th, 2007, 05:47 AM
Registered User
 
Join Date: Jul 2007
Location: Brussels, , Belgium.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old July 18th, 2007, 06:49 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old July 18th, 2007, 07:54 AM
Registered User
 
Join Date: Jul 2007
Location: Brussels, , Belgium.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old July 18th, 2007, 07:58 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
Reply With Quote
  #5 (permalink)  
Old July 18th, 2007, 08:04 AM
Registered User
 
Join Date: Jul 2007
Location: Brussels, , Belgium.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SOLVED - VBA Help For Row Source and Record Source eusanpe Access VBA 4 May 13th, 2008 11:58 AM
Colouring first record of report [Solved] Svenzardda Access VBA 1 July 18th, 2007 06:44 AM
Syntax Error -- BUG REPORT Solved dparsons MySQL 1 October 5th, 2006 01:38 PM
Dynamic bolding causes surrounding text to move. CFGerry BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 October 7th, 2005 06:50 AM
Bolding threads bmains Forum and Wrox.com Feedback 0 February 3rd, 2005 12:35 PM



All times are GMT -4. The time now is 06:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.