Open Picture from On Click

G

Guest

In a form I am pulling photos using the following code.

Private Sub Form_Current()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
On Error Resume Next
imgPicture1.Visible = True
imgPicture1.Picture = [Path_Name] & [Photo_Name] & ".jpg"
'Error message to display if photo not defined
If Err = 2220 Then
imgPicture1.Visible = False
Exit Sub
End If
End Sub

where Photo_Name is a column in the necessary table. Therefore each record
pulls a new photo. What I would like to do is "On Click" have this image act
like a hyperlink and open the image in Microsoft Picture Manager (or whatever
the defualt photo editor is set to). Thanks in advance for any help or
suggestions,

Cioffredi
 
J

John Nurick

The simplest way to open just about any document in its default program
is to use something like this:

Application.FollowHyperlink Me.Path_Name & Me.Photo_Name & ".jpg"



In a form I am pulling photos using the following code.

Private Sub Form_Current()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
On Error Resume Next
imgPicture1.Visible = True
imgPicture1.Picture = [Path_Name] & [Photo_Name] & ".jpg"
'Error message to display if photo not defined
If Err = 2220 Then
imgPicture1.Visible = False
Exit Sub
End If
End Sub

where Photo_Name is a column in the necessary table. Therefore each record
pulls a new photo. What I would like to do is "On Click" have this image act
like a hyperlink and open the image in Microsoft Picture Manager (or whatever
the defualt photo editor is set to). Thanks in advance for any help or
suggestions,

Cioffredi
 
G

Guest

John - Thanks a bunch. Here is what I ended up using for an event procedure

Private Sub imgPicture1_Click()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
Application.FollowHyperlink ([Path_Name] & [Photo_Name] & ".jpg")
End Sub

For whatever reason, it was struggling w/ the Me. ... But regardless, it
works and I thank you!

Cioffredi
John Nurick said:
The simplest way to open just about any document in its default program
is to use something like this:

Application.FollowHyperlink Me.Path_Name & Me.Photo_Name & ".jpg"



In a form I am pulling photos using the following code.

Private Sub Form_Current()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
On Error Resume Next
imgPicture1.Visible = True
imgPicture1.Picture = [Path_Name] & [Photo_Name] & ".jpg"
'Error message to display if photo not defined
If Err = 2220 Then
imgPicture1.Visible = False
Exit Sub
End If
End Sub

where Photo_Name is a column in the necessary table. Therefore each record
pulls a new photo. What I would like to do is "On Click" have this image act
like a hyperlink and open the image in Microsoft Picture Manager (or whatever
the defualt photo editor is set to). Thanks in advance for any help or
suggestions,

Cioffredi
 
G

Guest

Please help, I did the same thing as in this post. I stored the jpg file
name in the Photo_Name field of my table. I placed the "on current" code on
the properties of my form then the "on click" code on my unbound object
frame. But I get the error message, 2465. I can't figure out what I did
wrong.



Cioffredi said:
John - Thanks a bunch. Here is what I ended up using for an event procedure

Private Sub imgPicture1_Click()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
Application.FollowHyperlink ([Path_Name] & [Photo_Name] & ".jpg")
End Sub

For whatever reason, it was struggling w/ the Me. ... But regardless, it
works and I thank you!

Cioffredi
John Nurick said:
The simplest way to open just about any document in its default program
is to use something like this:

Application.FollowHyperlink Me.Path_Name & Me.Photo_Name & ".jpg"



In a form I am pulling photos using the following code.

Private Sub Form_Current()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
On Error Resume Next
imgPicture1.Visible = True
imgPicture1.Picture = [Path_Name] & [Photo_Name] & ".jpg"
'Error message to display if photo not defined
If Err = 2220 Then
imgPicture1.Visible = False
Exit Sub
End If
End Sub

where Photo_Name is a column in the necessary table. Therefore each record
pulls a new photo. What I would like to do is "On Click" have this image act
like a hyperlink and open the image in Microsoft Picture Manager (or whatever
the defualt photo editor is set to). Thanks in advance for any help or
suggestions,

Cioffredi
 
B

Bob Wickham

Freeda said:
Please help, I did the same thing as in this post. I stored the jpg file
name in the Photo_Name field of my table. I placed the "on current" code on
the properties of my form then the "on click" code on my unbound object
frame. But I get the error message, 2465. I can't figure out what I did
wrong.



:

John - Thanks a bunch. Here is what I ended up using for an event procedure

Private Sub imgPicture1_Click()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
Application.FollowHyperlink ([Path_Name] & [Photo_Name] & ".jpg")
End Sub

For whatever reason, it was struggling w/ the Me. ... But regardless, it
works and I thank you!

Cioffredi
:

The simplest way to open just about any document in its default program
is to use something like this:

Application.FollowHyperlink Me.Path_Name & Me.Photo_Name & ".jpg"



On Wed, 21 Dec 2005 11:00:02 -0800, Cioffredi


In a form I am pulling photos using the following code.

Private Sub Form_Current()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
On Error Resume Next
imgPicture1.Visible = True
imgPicture1.Picture = [Path_Name] & [Photo_Name] & ".jpg"
'Error message to display if photo not defined
If Err = 2220 Then
imgPicture1.Visible = False
Exit Sub
End If
End Sub

where Photo_Name is a column in the necessary table. Therefore each record
pulls a new photo. What I would like to do is "On Click" have this image act
like a hyperlink and open the image in Microsoft Picture Manager (or whatever
the defualt photo editor is set to). Thanks in advance for any help or
suggestions,

Cioffredi
Hi Freeda,
Just browsing because I just posted a question of my own.

If you are using this exact code cut and pasted from another post
Path_Name = "P:\PR40362\Database Photos\"

then you will need to adjust it to suit your own situation.

Bob
 
G

Guest

I apologize, I haven't been here in quite some time. I figured this thread
had died. Are you still having trouble. You probably have scrapped the idea
in its entirety by now but I'll check back in a few days in case. My
apologies.

Freeda said:
Please help, I did the same thing as in this post. I stored the jpg file
name in the Photo_Name field of my table. I placed the "on current" code on
the properties of my form then the "on click" code on my unbound object
frame. But I get the error message, 2465. I can't figure out what I did
wrong.



Cioffredi said:
John - Thanks a bunch. Here is what I ended up using for an event procedure

Private Sub imgPicture1_Click()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
Application.FollowHyperlink ([Path_Name] & [Photo_Name] & ".jpg")
End Sub

For whatever reason, it was struggling w/ the Me. ... But regardless, it
works and I thank you!

Cioffredi
John Nurick said:
The simplest way to open just about any document in its default program
is to use something like this:

Application.FollowHyperlink Me.Path_Name & Me.Photo_Name & ".jpg"



On Wed, 21 Dec 2005 11:00:02 -0800, Cioffredi

In a form I am pulling photos using the following code.

Private Sub Form_Current()
Dim Path_Name As String
Path_Name = "P:\PR40362\Database Photos\"
On Error Resume Next
imgPicture1.Visible = True
imgPicture1.Picture = [Path_Name] & [Photo_Name] & ".jpg"
'Error message to display if photo not defined
If Err = 2220 Then
imgPicture1.Visible = False
Exit Sub
End If
End Sub

where Photo_Name is a column in the necessary table. Therefore each record
pulls a new photo. What I would like to do is "On Click" have this image act
like a hyperlink and open the image in Microsoft Picture Manager (or whatever
the defualt photo editor is set to). Thanks in advance for any help or
suggestions,

Cioffredi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top