X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Enlarge An Image By Double-click, Access 2016    
post Feb 22 2020, 10:01 PM

Posts: 232
Joined: 6-February 03
From: Waiatarua, Auckland, New Zealand

Please forgive me if this is not the correct forum.
What I want to do has to be easy, but I do so little VBA these days that I am constantly having to re-learn.

I have a form that contains an embedded image. What I want to do is to double-click the image to see it enlarged, then double click the enlarged image to make it go away.
what I have tried is to have a separate form with an empty image control, which gets opened when I do the double click. What I can't do is to get the image from the original form to be associated with the image control in the new form.

Any help will be appreciated - and if there is an entirely better way I'd love to hear that as well.

Go to the top of the page
post Feb 22 2020, 11:49 PM

UA Moderator
Posts: 77,736
Joined: 19-June 07
From: SunnySandyEggo

Hi. Is the image associated with a record? If so, you can try opening the other form filtered to that record. Just a thought...

Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
post Feb 23 2020, 08:57 AM

UtterAccess Editor
Posts: 10,595
Joined: 8-November 07
From: South coast, England

Have you tried enlarging the image control in the double click event
Private Sub Image7_DblClick(Cancel As Integer)

If  Me.Image7.Height = 1000 then
   Me.Image7.Height = 4000
   Me.Image7.Width = 4000
   Me.Image7.Height = 1000
   Me.Image7.Width = 1000
End if

End Sub

Changing the image control name and the relevant values as appropriate.
This will need the section the image control is in to be big enough to take the enlarged image and you should ensure the control is at the front.

Otherwise open another form with a larger image control as theDBguy suggests.


Warm regards
Go to the top of the page
post Feb 23 2020, 09:04 AM

UtterAccess VIP
Posts: 2,211
Joined: 21-February 07
From: Copenhagen

In you main form, use the Click event of the picture to set the Picture property of the form to show the full picture:

Private Sub PictureShow_Click()

    ' Name of form to open.
    Const FormName  As String = "ZoomFlag"
    DoCmd.OpenForm FormName
    Forms(FormName).Picture = Me.PictureShow.Picture

End Sub

Set the "adjust picture state" (localised) property of the zoom form to: Zoom.

Use the Click event of the zoom form's Detail section to close the form:

Private Sub Detaljesektion_Click()

    DoCmd.Close acForm, Me.Name
End Sub

Microsoft Office 365 (Access) MVP 2017 ->
Go to the top of the page
post Feb 23 2020, 02:56 PM

UtterAccess VIP
Posts: 7,262
Joined: 30-June 11

I'm with Gustav, this is what I've done in the past. Setup another form to view the enlarged version of the image, use the original image's double-click event to open the form as modal and/or pop-up and then you can either use the enlarged images double-click or a separate button to close the enlarge form and return to the original calling form.

Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc

All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
post Feb 23 2020, 08:35 PM

Posts: 232
Joined: 6-February 03
From: Waiatarua, Auckland, New Zealand

I seem to have it sorted. As suggested, I opened another form in the double-click event, and set the picture property for the image placeholder, and that did it.

I knew it had to be easy! As I said in my original post I rarely do any Access coding these days, so every time it seems to be a new adventure. smile.gif

Thanks everyone.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    8th April 2020 - 04:29 PM