2 days ago: New Feature: you can now upload your Profile Picture to the site. Check it out!  Dismiss
 
Computer Learning Zone CLZ Access Excel Word Windows

There are wonders enough out there without our inventing any.

-Carl Sagan
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Code Vault > Access VBA > Check Icon File
Check Icon File
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   2 years 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
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 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/19/2024 5:56:39 AM. PLT: 0s
Keywords: code vault access check icon file check database icon filename  PermaLink  Check Icon File