I have noticed that when I add / update (not sure exactly what triggers this) an image to the Access Image Gallery and then put it on a form then upon the next time the form is opened I get
Is this something know to others?
My extended question here is that I also had a little look at the MSysResource table and manually changed a name. This too resulted in an error when opening the form but went away when I Compiled, Repaired as indicated above.
My understanding is that the Name column in MSysResouces is a key which is used by Access to get the image.
I am sure you want to write "Don't touch the system tables" and I would like to do this, however, I am thinking about the following;
I am thinking of making my icons themed. For example I have added to the Image Gallery two icons which are identical except that one is black and the other is white.
eg. wh_MyIcon and bl_MyIcon (being the names of the images in the Table)
A control on a form points to the Shared image wh_MyIcon. Now I thought I could be smart and in the MSysResouces table if I got these two rows and changed the Name in the row with wh_MyIcon to something else and the name in the row with bl_MyIcon to wh_MyIcon then now when the control on the form looks for wh_MyIcon it will actually get the black icon.
I have tested this and it works except for the problem I mentioned above also happens, in that the form does not open properly after the change. This would not be suitable when the form is being used by a user.
I am aware I could load the images on the fly from files, I'm also aware that I could loop through all image controls on a form and change the Picture property from wh_MyIcon to bl_MyIcon however both these things require extra code to be added to the Open event of a form and have to run every time. The above table changes means no extra work after of course the table has been changed.
I then worked out if I open the form > open the VBE > Debug > Compile, then Compact and Repair twice the form opens again without error."The OpenForm action was canceled. Error No. 2501"
Is this something know to others?
My extended question here is that I also had a little look at the MSysResource table and manually changed a name. This too resulted in an error when opening the form but went away when I Compiled, Repaired as indicated above.
My understanding is that the Name column in MSysResouces is a key which is used by Access to get the image.
I am sure you want to write "Don't touch the system tables" and I would like to do this, however, I am thinking about the following;
I am thinking of making my icons themed. For example I have added to the Image Gallery two icons which are identical except that one is black and the other is white.
eg. wh_MyIcon and bl_MyIcon (being the names of the images in the Table)
A control on a form points to the Shared image wh_MyIcon. Now I thought I could be smart and in the MSysResouces table if I got these two rows and changed the Name in the row with wh_MyIcon to something else and the name in the row with bl_MyIcon to wh_MyIcon then now when the control on the form looks for wh_MyIcon it will actually get the black icon.
I have tested this and it works except for the problem I mentioned above also happens, in that the form does not open properly after the change. This would not be suitable when the form is being used by a user.
I am aware I could load the images on the fly from files, I'm also aware that I could loop through all image controls on a form and change the Picture property from wh_MyIcon to bl_MyIcon however both these things require extra code to be added to the Open event of a form and have to run every time. The above table changes means no extra work after of course the table has been changed.