Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Check Icon File < Archive Records | Other Names >
Check Icon File
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   4 years ago

Update Database Icon if Folder Renamed or Moved


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

In this Microsoft Access tutorial, I will teach you how to reset the Database Icon if the user moves or renames the database folder.

Miriam in Rockford, Illinois (a Gold Member) asks: I have a small database that I use for my product lists and pricing. If I give a copy of this database to anyone else, like my customers, the icon doesn't seem to work. It's not a huge deal, but I'd like them to see my icon and not the Access logo. Any ideas?

Pre-Requisites

Links

Recommended Courses

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Diamond Sponsors - Information on our Sponsors
Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted
Merch Store - Get your swag here!

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

Keywords

access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, #fasttips, database icon, missing, relink, db.Properties("AppIcon").Value, dir, currentproject.path, folder moved, folder renamed, remap icon file

 

 

Comments for Check Icon File
 
Age Subject From
3 yearsCompile ErrorMonica Jones

 

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
 
Intro In this video, I will show you how to ensure your custom icon file continues to display properly with your Microsoft Access database even if the database folder is moved or renamed. We'll discuss why icons sometimes disappear when sharing your database, how to use a bit of VBA to detect and reset the icon file location automatically, and the best way to package your database and icon together for your users. This tutorial includes a walkthrough of the code needed to check and update the icon file path as your database opens.
Transcript Welcome to another Fast Tips video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.

In today's video, I'm going to show you how to update the database icon - this little guy down here in the taskbar and this little guy right there in the corner of your forms - if your database folder is moved or renamed in Microsoft Access.

Today's question comes from Miriam in Rockford, Illinois, one of my Gold members. Miriam says: I have a small database that I use for my product lists and pricing. If I give a copy of this database to anyone else, like my customers, the icon doesn't seem to work. It's not a huge deal, but I'd like them to see my icon and not the Access logo. Any ideas?

Well Miriam, if you are working with a split database on a network, for example, you just put the icon file wherever the backend database file is, and that's got to be the same for everybody. But if you're in a situation where you just have a single database with your products and your pricing, and you give it on a regular basis to your customers, then yes, if you are going to ship a logo file with it, and their folder doesn't match yours exactly, then they're not going to see it. Let me demonstrate.

Before we get started, this is a developer-level tip - see that little guy right there? That means you're going to need to know a little bit of VBA. There's not a ton of VBA in this video, maybe half a dozen lines.

If you've never done any VBA programming before, go watch this video. It's about 20 minutes long, and it will teach you everything you need to know to get started.

Also, if you've never set the database title or icon before and you want to learn how to do that, go watch this video. This is more of a beginner's video.

Here I've got my database file. It's just a copy of my TechHelp database. You've probably seen this before. Here I've got my little logo file, a little icon file. If you don't have an icon file, you can go find them - just Google it. There are a million sites out there that have tons of different icon files available.

I'm going to put these in a folder. The key here - see what I did there? - I'll call this folder DB for my database. Now, I'm going to put both of those files in that folder. This represents your database folder, wherever that happens to be.

We're going to set this icon file as the icon for my database. Let me open this up, and we're going to go to File - Options. You see I keep going to Tools - Options, but that's going back like 20 years.

You can change the title here if you want to. Here's the icon file - you're going to browse to it. So, on my desktop, in my DB folder, and there it is right there.

I'm going to use this also as the form and report icon, and that will hide the Access logo on my forms and reports too. It says you have to close and reopen the database, but you don't. Now you can see the little icon there, and you'll see it down on your taskbar as well.

Now here's a problem: Close that database. If this folder moves or is renamed - you can simulate moving it or giving it to a different customer by just renaming it; call it something else. If you give it to them, they might not have it in C:\\Users\\Richard\\Desktop\\DB. Their path is going to be different.

Now I just renamed this. If I open up this database now, look at that: no logo there and no logo down there.

Why is that? Because if you go to File - Options, it's looking for C:\\Users\\Amicron\\Desktop\\DB\\whatever.

So what we're going to do is write a little function - a little subroutine, technically - that's going to say: When the database opens, we're going to look and see if this file exists. We're going to get the icon property from the database object and say, "What's your icon set to?" Then we're going to look to see if that file exists on the hard drive. If it doesn't, then we're going to look to see if that same file exists in the current database folder, and if it does, we're going to reset the icon property. There are a couple of other minor steps in there too.

Basically, yes, the icon file will have to be kept with the database in the same folder. If you're going to give them a copy, I'd make a zip file and tell them to extract all the files in that zip file to the same folder.

So how do we do all this? We're going to take a trip over to my Code Vault and get a particular procedure that I wrote. Here's the page on my website in the Code Vault. This is normally reserved for Gold members, but I'm letting you guys in on this special secret one. Don't tell everybody.

Once in a while, I open up stuff in the Code Vault for everybody. I'll put a link to this page down below in the link section in the description below the video, so you can just click on it. It'll take you right here.

Here's the code. We're going to click this button to copy it. That copies it to your clipboard. We're going to go drop it into our database.

In your database, if you don't already have a global module, make one. It's just under Create and then Module. You can create a global module that way. But I already have one here. I'm going to open that up, and I'm going to paste that code right in here. This is all it is.

Let me walk you through what it does. The first thing it does is set a variable called "DB" to the current database. Then it sets the icon file equal to whatever the current project path is - so that's whatever folder your database is running in or located in. So, it could be C:\\Database or whatever, and then it tacks on the name of your icon file. So, you have to either change this or name your icon "mylogo.ico" or whatever you want to use.

Next, it's going to look at the properties of the database and find the AppIcon property. That's the path and file name of whatever the icon file setting is in your database - that you set earlier, manually.

We're going to use the Dir function and say, "Does this file exist?" If the file doesn't exist, then Dir returns an empty string, and now we know that whatever the icon file is set to in the database properties isn't there.

Now I'm going to look and see: Does this icon file exist in the database folder? If it does, then we're going to go ahead and set the properties. So, we have to set the database icon database property to the new icon file, which is pointed to the new one in the database folder.

We're going to refresh the title bar. Now, it says "refresh title bar," but it also refreshes the icons - the taskbar icon and the icon at the top of the form. If your main menu is open, you're going to have to close it and reopen it. That's why we had to put this in a global module instead of in the code in the startup form itself - because you have to close that form and then reopen it. Otherwise, the little form icon at the top won't change. You have to close the form and then reopen it, which will cause this code to run again, but now it should find the file.

How do we kick this off? We put this in the main menu's On Load event or On Open event. I use On Load because it's easier to find. Right here, we'll just say CheckIconFile, and that will run when the form loads up.

Close that, they've changed us, we're going to close the database down, and I remember I renamed the folder, so when I open it at this point, it should reset the logo to that logo file. Ready and... go!

And nothing happened. Why is that? I made this mistake twice myself until I realized what I did. Remember the code - you have to rename this logo file or change the logo file name in the code. This has to be mylogo.ico or change it in the code. I'm going to call it amicron.com.ico or whatever you want to call it now. If I run it, everything resets.

The main menu loaded, it saw the icon wasn't there that was set in the database properties, and it did find it in the current database folder. So, it reset the database property, refreshed the title bar, which gives you that icon, and then it reset this guy by closing and reopening the form.

Now it doesn't matter if you rename this folder, move it, copy it, or give it to someone else. I just made a complete copy of it. Here is the copy - open the copy up, run your database, and boom - it found its own icon file. Technically, this one could find the icon file in the other folder too, so if you really want to make sure, what you'd have to do is you'd have to copy this, and then delete the original. Now you're absolutely sure it's not finding that file.

Now if I open it up and run it, you can see it reset the icon file automatically.

Pretty cool stuff.

If you like learning stuff like this, come and check out my developer courses. I've got over 60 hours of developer lessons on my website. I've got Developer 1 through 42 or 43, I think I'm on right now. Lots and lots of stuff to learn. This is just a small tip. I cover all kinds of good stuff like this in my full courses.

For example, in Developer 30, I cover classic VB file input and output - reading and writing text files, lots of uses for text files. In fact, I was just reading an article in one of the financial magazines (Forbes or one of them), where they talked about how CSV files - text files - are still the number one way that data is transferred around the web, from banks and financial institutions. So, text files aren't going anywhere.

If you do any work with text files, you're going to want to learn how to read and write them manually using Access. I cover that in Developer 30, including the Dir function.

Gold members, I will save this database for you. You can download it off the website. There is your zip file. I'll put it up on the server.

This video brings to mind another video I did a little while back called Relinking Tables - same concept. If you've got a backend - your database is split, and you've got backend table database files, and they move or get renamed, or you give this to someone else and they've got a different location for them, I've got a video that shows you how to relink those tables.

The free TechHelp video showed you how to do it manually. In the extended cut for members, I show you how with some VBA, you can automatically relink them if they move - really cool stuff.

And yes, I was also thinking it would be possible to store that icon file inside the database. As much as I hate using the attachment data type, it does have a purpose once in a while. I wouldn't use it for storing all kinds of files, but you could store a support file or two in there, like a little tiny icon file in an attachment, and then you could extract that attachment if the database icon file is not found from the database properties. You could then extract the logo out of that attachment file, which is stored in the table, and then map to that. So you can do that too.

I'm going to be covering - I haven't covered this yet - extracting attachment files out of the database and storing them in normal folders, like you should do, in an upcoming developer lesson. I did have a customer, a student, who said he just inherited a database, and his predecessor stored all kinds of stuff - thousands and thousands of files, resumes, and so on - in the database, and he wants to get them out of there. But to do it by hand would probably take a year, and I'm going to show him how to do it with just a couple of clicks.

That is your Fast Tip for today. I know it's not quite so fast because I rambled on for a little bit, but sometimes I do that.

I hope you learned something and I'll see you next time.
Quiz Q1. What is the main problem addressed in this video?
A. Users cannot open the database when the folder is moved
B. The custom database icon does not display when the database is moved or copied
C. Access crashes when moving the folder
D. The database title disappears when renamed

Q2. Why might the icon file not display for other users when you distribute your Access database?
A. Because their copy of Access is outdated
B. Because the icon file path is hardcoded and may not match their folder structure
C. Because Access does not support custom icons
D. Because the database file becomes corrupted

Q3. What is recommended to keep the icon file visible when giving the database to someone else?
A. Email only the icon file separately
B. Keep the database and icon file together in the same folder
C. Store the icon file on a network server
D. Use a JPG file instead of an ICO file

Q4. Which function is used in VBA to check if a file exists?
A. ExistsFile
B. FileFound
C. Dir
D. SearchFile

Q5. Where should you paste the VBA procedure that checks for and updates the icon file path?
A. In the Form's code module
B. In a global module
C. In a query
D. In the table's design view

Q6. What event on the main menu form runs the CheckIconFile subroutine?
A. On Click
B. On Close
C. On Open or On Load
D. On Resize

Q7. Why might the icon not update immediately after running the update code?
A. The database must be reinstalled
B. The main menu form must be closed and reopened for the icon to refresh
C. The database needs a reboot
D. Access does not support this feature

Q8. What should you do if you change the icon file's name?
A. Change the filename in the database properties or update the name in the code
B. Only rename the file on disk
C. Just move the icon file
D. Reinstall Microsoft Access

Q9. What is an alternative approach discussed for storing the icon file?
A. Emailing it to users each time
B. Storing the icon inside the database as an attachment
C. Using Google Drive links
D. Embedding it in a report

Q10. What is the main advantage of using the Dir function as covered in this video?
A. It allows you to zip files automatically
B. It checks for the existence of a file at a specific location
C. It saves the icon file to cloud storage
D. It opens forms automatically

Answers: 1-B; 2-B; 3-B; 4-C; 5-B; 6-C; 7-B; 8-A; 9-B; 10-B

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary Today's video from Access Learning Zone covers how to update your database icon in Microsoft Access if you move or rename your database folder. Often, when you set up a custom icon for your Access database, you want that icon to appear in the taskbar and in the corner of your forms, replacing the default Access logo. However, if you distribute copies of your database or if the folder is moved or renamed, that icon might disappear.

This issue was brought up by Miriam, who uses a small Access database to manage her product lists and pricing. She noticed that when she gives copies of her database to customers, her custom icon no longer appears, and Access reverts to its own logo. The root of this problem is that Access stores the full file path of the icon you set. If someone uses your database in a different folder, Access cannot find the icon file using the original path.

If you work with a split database on a network, the icon file should reside in the same location as the backend for everyone. But if you distribute copies of a single database to users who will store it in different folders, then unless the icon file is in the exact same place on their computer, Access will not be able to find it.

To show how this works, I start with a sample database and an icon file together in a folder. To set the icon, you open the database options and select your icon file. You can also choose to use this icon for your forms and reports, replacing the Access logo in those places as well. Normally, Access keeps showing your icon as long as the database and the icon file remain in the same location.

However, if you later move or rename the folder — or if someone else puts the files in a different location — opening the database will result in the icon vanishing because Access cannot resolve the original path for the icon file. When you look in the database options, Access is still searching for the icon in the old path.

To solve this, we turn to a small VBA routine. This solution checks for the icon file when the database opens. First, it looks at the database's current AppIcon property to find the path Access is trying to use. Then, using the Dir function, it verifies whether the file exists at that path. If not, it checks whether a file with that same name exists directly in the current database folder. If it finds the icon there, the routine updates the database property to use the icon from the new location and refreshes the application windows so the icon reappears immediately for the user.

You need to keep the icon file in the same folder as the database file you distribute. If you are giving the database to someone else, I recommend creating a zip file that contains both the database and the icon, with instructions to keep them in the same folder.

To use the code, copy it from my Code Vault on the website (there is a special public link provided for this Fast Tips video). Paste the procedure into a global module in your database. Once there, set the correct name for your icon file within the code. If your icon file uses a different name, update the code accordingly.

With the routine in place, call it from your main menu form's On Load event. This makes sure that every time the database opens, it checks for the icon and resets it if needed. If you change the folder name, distribute the files, or make a copy and open it elsewhere, the code will detect the local icon and update the database properties so your custom logo appears in both the forms and the taskbar.

If you do not set the correct icon filename in your code, your database will not be able to find the icon and show it properly, so always ensure the filenames match. Test by making a copy of the folder, renaming it, or deleting the original to confirm the database can adapt to its new location.

This method works whether you rename or move the folder or send the database to another user. It is a simple but robust way to keep your database looking professional, no matter where it is used.

For anyone interested in more advanced Access topics, my developer courses dive much deeper. There are over sixty hours of developer lessons available on my website, covering everything from file management to reading and writing text files manually, which Access still does with text and CSV files as they remain vital for data transfer.

For those needing to extract files attached in Access databases — perhaps to move them into standard folders — I will be covering that soon in upcoming lessons. If you inherit a database with lots of attachments and need to export everything, I will show you how to automate that process.

If you want a complete step-by-step walkthrough of everything I discussed here, including how to obtain and install the code, you can find a full video tutorial on my website at the link below. Live long and prosper, my friends.
Topic List Updating the database icon when the database folder is moved or renamed

Setting a custom icon for an Access database

Locating and selecting the icon file for the database

Understanding the effect of moving or renaming the database folder on icon display

Explaining the AppIcon property in Access

Using VBA to check if the icon file exists at the specified path

Programming a subroutine to reset the icon path if the file is missing

Searching for the icon file in the current database folder using VBA

Setting the AppIcon property in VBA

Refreshing the title bar and icon programmatically

Placing the VBA function call in the Main Menu form's On Load event

Handling folder renames and moves to maintain custom icons

Ensuring the database and icon file are kept together for distribution

Modifying the VBA code for a different icon file name

Copying and pasting VBA code into a global module

Testing the icon reset process after folder changes or file copies
 
 
 

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: 4/30/2026 12:06:49 PM. PLT: 2s
Keywords: FastTips Access database icon, hide access, missing, relink, db.Properties, dir, currentproject.path, folder moved, folder renamed, remap icon file, Application.RefreshTitleBar  PermaLink  Check Database Icon File in Microsoft Access