Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application icon 1

Status
Not open for further replies.

AndyH1

Programmer
Jan 11, 2004
350
GB
I have an Access database and want to associate an application icon to it. However, since I don't know where the person will put it on their computer I cannot simply set it in the tools > startup options > application Icon option as this needs the directory. The icon is in always in the same directory as the database. is there any way of programming so that I get the current directory and then set the application icon (ie in VBA)?
Thanks
Andy
 
If the icon file is always going to be in the same directory as the database, you can use a line of code like this to set the application icon:
Code:
CurrentDb.Properties("AppIcon").Value = Application.CurrentProject.Path & "\myIcon.ico"
Obviously substituting myIcon.ico for the filename of your icon.

This will work fine and you can put it anywhere - in a function that you call at startup from an AutoExec macro (read more about this at or in the OnLoad event of a startup form.

However the user has to have Admin privileges to be able to set this property at run-time, so if you're database is secured to a user-level you might have to think carefully about this.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top