update an image in image gallery (1 Viewer)

saqassemi

Registered User.
Local time
Today, 01:36
Joined
Nov 11, 2017
Messages
37
Hi, is there any macro or code to update an image in image gallery? I know that it is possible with right click on images in gallery but I need to do it after saving with ACCDE file.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:36
Joined
May 21, 2018
Messages
8,525
Can you provide more detail. I have no idea what that means.
 

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,466
Same here. What image gallery where?
 

saqassemi

Registered User.
Local time
Today, 01:36
Joined
Nov 11, 2017
Messages
37
Can you provide more detail. I have no idea what that means.
There is an option with the name of (insert image) in Form Design Tab. If you insert one or more images, by clicking on (insert image) it shows a title (image gallery) and when you right click on an image and select update you can change the image and all before image that you used in forms and reports will update.
so I want to update an image in my forms and reports by one click when the forms and reports are not editable in design view after saving with ACCDE format.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:36
Joined
Feb 28, 2001
Messages
27,140
I am going to assume that you have a command button of some sort that has a symbolic graphic on it rather than text (i.e. a caption). (Technically, it is called a "Picture Caption.") The reason I make that assumption is that for an image control, you just use code to replace the .Picture path from some file on your computer. It isn't quite so clear for command buttons because you don't know where those images are stored.

Well, here's what you do for command buttons. Get into form Design View. Select the control, bring up the property sheet, and what you want is on the Format tab. There is a property called .Picture which, if you click in the box next to that name, shows you the down-pointing triangle and the ellipsis (...) button. Click on the ellipsis button to get a pop-up form that is a list of possible images you could select. Make your selection, close, and switch to Form View to verify. If that's it, save the changes and you are done.

If this is not what you meant, then you have to clarify the context a LOT more.
 

isladogs

MVP / VIP
Local time
Today, 09:36
Joined
Jan 14, 2017
Messages
18,209
As I said in your other thread, ACCDE files are designed to be locked down.
You cannot open forms in Design view in an ACCDE file nor do you have access to the Design ribbon so therefore the Image Gallery is also unavailable.

See my answer in your other thread for a better solution
 

saqassemi

Registered User.
Local time
Today, 01:36
Joined
Nov 11, 2017
Messages
37
As I said in your other thread, ACCDE files are designed to be locked down.
You cannot open forms in Design view in an ACCDE file nor do you have access to the Design ribbon so therefore the Image Gallery is also unavailable.

See my answer in your other thread for a better solution

Yes so I want to know is there a macro or code to update an image in all forms without using design view.
And there are many codes that change all designs in forms not in design view.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:36
Joined
Feb 28, 2001
Messages
27,140
I missed the .ACCDE part earlier.

Once the .ACCDE is locked down, your problem is that you cannot make this change. In order to now add code to the .ACCDE to allow the app to make its own change, you would have to be able to enter Design View anyway to add the desired code. But not in .ACCDE, because you can't do that.

And I don't believe you can do that from an external file that would somehow map to the .ACCDE file because you STILL can't get to Design View.

This is why you ALWAYS have an unlocked design master copy sitting in the wings. Instead of going to the trouble of attempting to decompile the file, you just replace it with a new file which you make by copying the master in its updated state and the make your .ACCDE from the new copy, replacing the old one.. And that is ALSO why you split databases. Because if you do this with a split DB, you just update and replace the FE leaving the BE intact.
 

saqassemi

Registered User.
Local time
Today, 01:36
Joined
Nov 11, 2017
Messages
37
I missed the .ACCDE part earlier.
Once the .ACCDE is locked down, your problem is that you cannot make this change.
It is clear that the ACCDE file is not editable and I don't want to edit an ACCDE file. I have an ACCDB file and I am making a Settings form. My Setting form can change the font, font size, color and ... and I want to add another options like changing logo of all forms and reports by one click. When all done I will save my DB as ACCDE.
In another thread my problem solved:
https://www.access-programmers.co.uk/forums/showthread.php?t=300214
But this is my question in this thread:
There is an option with the name of image gallery in a form Design View, when we click on insert image we can select an image, delete, rename and update it.
Is there a macro or code to run Update option in galley outside of design view?
 
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:36
Joined
May 21, 2018
Messages
8,525
If I understand correctly you want to change embedded images and not use a reference to a path as has been suggested.
This work for me. On my settings form I have a button to select an image. I wrote this for two forms, but obviously simple to add all my image controls. Or you could loop all forms and see if there is an image control with a tag to change. The load code is recycled and can be used in a form to show hide the control if an image is present.

Code:
Private Sub cmdChangeImage_Click()
  Dim strPath As String
  Dim frm As Access.Form
  Dim ctrl As Access.Image
  strPath = mdlBrowseForFile.GetOpenFile
  DoCmd.OpenForm "frmEmployees", acDesign, , , , acHidden
  Set frm = Forms("frmEmployees")
  Set ctrl = frm.ImageEmployee
  mdlLoadImage.LoadImage strPath, ctrl
  DoCmd.Close acForm, frm.Name, acSaveYes
  'Next form  
  DoCmd.OpenForm "frmCustomers", acDesign, , , , acHidden
  Set frm = Forms("frmCustomers")
  Set ctrl = frm.ImageCustomers
  mdlLoadImage.LoadImage strPath, ctrl
  DoCmd.Close acForm, frm.Name, acSaveYes
End Sub



Public Sub LoadImage(strImagePathAndFile, mImageControl As Access.Image)
   Dim objFileSystem As Object
   Dim connection As String
   Set objFileSystem = CreateObject("Scripting.FileSystemObject")
   On Error GoTo PictureNotAvailable
   mImageControl.Visible = True
   If objFileSystem.FileExists(strImagePathAndFile) Then
      mImageControl.Picture = strImagePathAndFile
      mImageControl.Visible = True
   Else
      mImageControl.Picture = ""
      mImageControl.Visible = False
   End If
   Exit Sub
PictureNotAvailable:
   MsgBox Err.Number & "  " & Err.Description & Chr(13) & "In PictureFromFile Class"
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:36
Joined
May 7, 2009
Messages
19,232
i am not in computer but the Gallery you are talking about is when your Image is shared.
you can find the image in one of Msys tables. The image is saved in this table as Attachment.

so there is the same similarity to the code i provided you in the other thread.
 

Users who are viewing this thread

Top Bottom