double click on picture frame in the form to enlarge the picture (1 Viewer)

hfsitumo2001

Member
Local time
Today, 00:06
Joined
Jan 17, 2021
Messages
365
Hello in the form of my inventory I have picture of the supplies, does eanyone can give me the sample of enlarging the picture on double click on the frame?.
I had mine but it was 14 years ago, and since I moved to US and I stopped doing office work, coz now I work as a housekeeping in the US, I forgot a lot, now I started to revive my brain, so I am trying to build an inventory system in MS Access.

What I have here is even difficult for me to follow because it was in multilanguage 14 years ago,
Code:
Private Sub ImageFrame_DblClick(Cancel As Integer)
Dim StrMsg As String
If Nz(ImagePath, "") <> "" Then
Echo False
DoCmd.OpenForm "GambarBesar"
Forms!GambarBesar!ImageFrame2.Picture = ImagePath
' Note: This is message string #8.
     StrMsg = DLookup("MessageString", "[Lookup Message String_Qry]", "[FormName] = '" & Me.Name & "' AND [StringNumber] = 8")
Forms!GambarBesar.Form.Caption = StrMsg & FullName
Echo True
Else
' Note: This is message string #9.
     StrMsg = DLookup("MessageString", "[Lookup Message String_Qry]", "[FormName] = '" & Me.Name & "' AND [StringNumber] = 9")
' Note: This is message string #10.
     StrMsg = DLookup("MessageString", "[Lookup Message String_Qry]", "[FormName] = '" & Me.Name & "' AND [StringNumber] = 10")
MsgBox StrMsg, vbCritical, StrMsg
End If
End Sub

Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me!ImagePath = "C:\Churchdata\Gambar\" & Me![ImagePath]
Dim strPicturePath  As String
strPicturePath = Nz(Me.ImagePath, "")
If Len(strPicturePath & "") < 22 Or Len(Dir(strPicturePath)) = 0 Then
    strPicturePath = "C:\Churchdata\Gambar\Nopicture.jpg"
End If
Me.ImageFrame.Picture = strPicturePath

 '   If Not (IsNull(Me.ImagePath)) Then
  '          Me.ImageFrame.Picture = Me.ImagePath
   ' End If
End Sub

Now mine is not using image path, but as attachment field in the inventory table. It should be on image frame control property

Thanks for any help
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:06
Joined
Jul 9, 2003
Messages
16,280
The best way is to have a path to an image stored on your hard drive. Having images stored in a table is not considered a good way of handling images.

I would suggest you tackle the problem somewhat similar to the way it is tackled on websites. You have two images, one small and one large, and the click will show either one or the other, depending.
 
Last edited:

Users who are viewing this thread

Top Bottom