Computer Learning Zone CLZ Access Excel Word Windows

If GM had kept up with technology like the computer industry has, we would all be driving $25 cars that got 1,000 MPG.

-Bill Gates
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
Home > Code Vault > Access VBA > Check Icon File
Check Icon File
By Richard Rost   Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   9 days ago

Put this code in a Global Module. Call it from your Startup Form in the On Load or On Open event. It will check to see if the database's icon file is present. If not, it will see if the file is in the current (database) folder. If so, it will reset it. Obviously change the name of your ICO file.

Code

Public Sub CheckIconFile()

    Dim db As Database, IconFile As String
    
    Set db = CurrentDb
    IconFile = CurrentProject.Path & "\MYLOGO.ICO"
    
    If Dir(db.Properties("AppIcon").Value) = "" Then ' Icon file not found. Resetting it.
        If Dir(IconFile) <> "" Then ' Icon file exists, update property
            db.Properties("AppIcon").Value = IconFile
            Application.RefreshTitleBar ' Refresh Access TaskBar logo
            DoCmd.Close acForm, "MainMenuF", acSaveYes ' close/reopen main menu
            DoCmd.OpenForm "MainMenuF"
        End If
    End If
    
End Sub

Usage

In your startup form's On Load event, just say:

CheckIconFile

I cover this in my Check Icon File Fast Tip video.

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Check Icon File
Get notifications when this page is updated
 
 
 
 

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
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
amicron@gmail.com
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn
Keywords: code vault access check icon file check database icon filename  PermaLink  Check Icon File