Application icon source from table in ms access (1 Viewer)

Ihk

Member
Local time
Today, 19:04
Joined
Apr 7, 2020
Messages
209
I am looking for a way out to source ms access application icon from ms access table itself.
Normally icon file is kept with backend file. But in this case it will be user choice to replace it, which I dont want. Is there any way out source it from backend table itself?
Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:04
Joined
Oct 29, 2018
Messages
18,989
Not sure I understand your question.
 

Ihk

Member
Local time
Today, 19:04
Joined
Apr 7, 2020
Messages
209
Not sure I understand your question.
I have attached picture, highlighted (??????)
Application icon, normally comes by browsing to the path whereever it is kept. I used to keep it at the path where backend is kept. But this ICON file is in user control, if he wants to remove it can remove it.
I want this to source it from database itself (for example any table). is this possible somehow?
 

Attachments

  • Application ICON.png
    Application ICON.png
    24.5 KB · Views: 98

theDBguy

I’m here to help
Staff member
Local time
Today, 10:04
Joined
Oct 29, 2018
Messages
18,989
I have attached picture, highlighted (??????)
Application icon, normally comes by browsing to the path whereever it is kept. I used to keep it at the path where backend is kept. But this ICON file is in user control, if he wants to remove it can remove it.
I want this to source it from database itself (for example any table). is this possible somehow?
Ahh, maybe take a look here.

 

June7

AWF VIP
Local time
Today, 09:04
Joined
Mar 9, 2014
Messages
4,381
I tested in a form Open event:
CurrentDb.Properties("AppIcon") = "C:\Users\Owner\June\MyStuff\snowboarder2.ico"

I discovered that if the property was not already set with an image, the code will error "Property does not exist". So tried:

CurrentDb.Properties.Append CurrentDb.CreateProperty("AppIcon", dbText, "C:\Users\Owner\June\MyStuff\snowboarder2.ico")

The property is changed but image does not show until next time db is opened.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:04
Joined
Oct 29, 2018
Messages
18,989
Thanks @theDBguy
Maybe can you narrow down how to handle the app icon scenario.....how to apply the command

CurrentDB.Properties. then ..........
Hi. I was going to say the same thing as @June7 did. Before you deploy your app to the user, make sure to set the App icon setting first. Then, I would suggest storing the icon in an Attachment field. When the app opens, you can check the app icon setting and reset it, if the user changed it. To reset the app icon, you will have to extract the app icon from the Attachment field and then use the AppIcon property to assign the original icon, and then restart the app.
 

sonic8

AWF VIP
Local time
Today, 19:04
Joined
Oct 27, 2015
Messages
593
The property is changed but image does not show until next time db is opened.
You can call Application.RefreshTitleBar to immediately update the displayed icon.

Application icon, normally comes by browsing to the path whereever it is kept. I used to keep it at the path where backend is kept. But this ICON file is in user control, if he wants to remove it can remove it.
I want this to source it from database itself (for example any table). is this possible somehow?
This is only possible indirectly.
You can store your own application icon in a database table.
In the startup code of your application, you then extract the icon from the table to a file and set the AppIcon property to the extracted file, as discussed above. - If you repeat this on every startup you made sure the user cannot replace the icon.
 

June7

AWF VIP
Local time
Today, 09:04
Joined
Mar 9, 2014
Messages
4,381
Why are users even getting access to db Options settings if you don't want them to change stuff? Implement settings and custom ribbon to prevent (or at least make it harder).

Why would user even want to do this? Every time a new version of frontend is distributed, their options will be negated.
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:04
Joined
Sep 21, 2011
Messages
10,559
I have to ask.
Why is so important to you to stop a user using an icon they want, to identify your db? :(
 

Ihk

Member
Local time
Today, 19:04
Joined
Apr 7, 2020
Messages
209
Thank you very much for your suggestions. I have implemented successfully as @sonic8 said above.
> 1) table containging logo / icon
> 2) module to export that icon in user/documents (Environ$ - user profile), because each user name on each pc will be different
> 3) same path is saved under >file > options > Current database > application ICON by access default browse method
> 4) I run that module on start of access database (on load of 1st form).
> This way it automatically exports icon file. Even if user remove that file, this export process will start every time.
> In that case only 1st run will not show ICON, but second and onward run of access db will display (except if file is removed again).

To show icon immediately, I tried Application.RefreshTitleBar , this method works half way. Meaning icon appears on taskbar but wont and never appears on each form. So I stopped using Application.RefreshTitleBar

@jaikaoliver
may be this is helpful for you.
 
Last edited:

jaikaoliver

Member
Local time
Today, 10:04
Joined
Nov 18, 2019
Messages
35
Thank you very much for your suggestions. I have implemented successfully as @sonic8 said above.
> 1) table containging logo / icon
> 2) module to export that icon in user/documents (Environ$ - user profile), because each user name on each pc will be different
> 3) same path is saved under >file > options > Current database > application ICON by access default browse method
> 4) I run that module on start of access database (on load of 1st form).
> This way it automatically exports icon file. Even if user remove that file, this export process will start every time.
> In that case only 1st run will not show ICON, but second and onward run of access db will display (except if file is removed again).

To show icon immediately, I tried Application.RefreshTitleBar , this method works half way. Meaning icon appears on taskbar but wont and never appears on each form. So I stopped using Application.RefreshTitleBar

@jaikaoliver
may be this is helpful for you.
Thanks All, Helped!
 

sonic8

AWF VIP
Local time
Today, 19:04
Joined
Oct 27, 2015
Messages
593
To show icon immediately, I tried Application.RefreshTitleBar , this method works half way. Meaning icon appears on taskbar but wont and never appears on each form. So I stopped using Application.RefreshTitleBar
Application.RefreshTitleBar only refreshes the main application window icon immediately. All open forms will not be affected immediately, but only when they are closed and reopened. - I just noticed in Access 365 current, the icon of tabbed MDI forms will only change after restarting Access, they first go blank when changing the icon file.
In any case, Application.RefreshTitleBar just doesn't help to fix the issue but it doesn't make matters worse.
 

Users who are viewing this thread

Top Bottom