Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Developers    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Bold Report on flag
Sami Shamma 
             
3 years ago
Greeting gentlemen

I am trying to bold/not bold my report based on a value (BoldReport) in my DefaultT.

I placed the following code in "On Load" event in my report:
Private Sub Report_Load()
   Dim vBold As Boolean
   vBold = DLookup("BoldPrint", "DefaultT", "DefaultID = 1")
    If vBold Then
        HousingCode.FontBold = True
        FullName.FontBold = True
    Else
        HousingCode.FontBold = False
        FullName.FontBold = False
    End If
End Sub

it dose not work the first time i fire the report. BUT it works the second time I open the report.

Help!

Many Thanks
Jerry Fowler  @Reply  
       
3 years ago
I am in no way proficient in Access but using the On Current Event might make a difference.  Hope it helps
Kevin Robertson  @Reply  
           
3 years ago
Try the Format event of the section.
Kevin Yip  @Reply  
     
3 years ago
What exactly happens when it "does not work"?  Does it not show bold when you expect it to, or vice versa?  Does it give you a run-time error?  For instance, if DLookup() doesn't find a result, it returns null; and when vBold is null, you get a run-time error.
Sami Shamma OP  @Reply  
             
3 years ago
I get no errors. This what happens:
I change the flange to bold.
I run the report (no bold)
Close report and run again, now it is bold.
Sami Shamma OP  @Reply  
             
3 years ago
Mr Yep
I did try the format event as well. Same results
Kevin Yip  @Reply  
     
3 years ago
You need to check what value vBold gets from DLookup() when it doesn't set the textbox to bold.  Set a break point on the line "If vBold Then".   Run the report, when the yellow line pauses on "If vBold Then", use the mouse to hover over vBold and see what it is.  Or you can type this on the Immediate Window:

     ?vBold

and press Enter.
Sami Shamma OP  @Reply  
             
3 years ago
Thanks, I will try this in the morning.
Sami Shamma OP  @Reply  
             
3 years ago
Friends,
I have found the problem. The code and its location are correct. The problem was with the flag remaining dirty when I change it. a me.requery in after update on the flag solved the problem.

Thank you everyone for your help.

Dr. Sami Shamma

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developers.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/26/2026 4:44:00 PM. PLT: 1s