Double Clicking Record In List Box to Open Hyperlink

springa

Registered User.
Local time
Today, 14:47
Joined
Dec 1, 2008
Messages
27
Hi all,

Seems I have a lot of questions today! I have a list box on a form with four columns/fields : Item Name, Item Category, Item Description and Item Photo. The Item Photo is a hyperlink to a file for that specific item's photo on a networked PC.

Is it possible to: on double clicking the particular record in this list box, open the hyperlink?

Thanks very much!:rolleyes:
 
FollowHyperlink ListBox1.Column(3, ListBox1.ListIndex)
 
Hi,

I have a similar issue and I would appreciate if you can help me.

I haver just added to my table a field named "FrontImgFile" to contain a path of an image associated with the record i'm focusing on.

before I added this field I used code to open information from the form that the image contained.

so what i have now is some records with an image path and some not.

can you help me add some code to open the image with the image path first and then if there isn't a path in the field it shall use the old code?

here is the existing code:

Private Sub txtAmount_DblClick(Cancel As Integer)

If cboType = 1 Or cboType = 3 Then
On Error GoTo errViewImage
Dim sFileName As String

sFileName = "_Ref-" & RefNo & "_ID-" & txtClientID & "_" & txtCheckID
sFileName = Replace(sFileName, "?", "z")
sFileName = Replace(sFileName, " ", "_")
sFileName = sFileName & ".tif"
On Error GoTo ChangeFileName
Call Shell("cmd /c start " & Forms.frmcompanyinfo.subProgramPrefs.Form.txtImagePath & sFileName)
Exit Sub

ChangeFileName:
sFileName = txtTransactionNo & sFileName
On Error GoTo errViewImage
Call Shell("cmd /c start " & Forms.frmcompanyinfo.subProgramPrefs.Form.txtImagePath & sFileName)
Exit Sub

errViewImage:
MsgBox Err.Description & " " & sFileName
End If

End Sub
 
Hi,

I can't seem to get this to work. On double clicking the sunset record, it comes up with the following errors as per the attached picture. Thanks very much for your help.
 

Attachments

  • Hyperlink.JPG
    Hyperlink.JPG
    97 KB · Views: 612
I don't know if this is of any use to you blokes but:)

Forms!LN!Command5.HyperlinkAddress = ("C:\StoreLetters\" & Format([Forms]![LN]![LNameNoDoc]) + ".doc")

When the Command5 button is clicked it first inserts the details for the hyperlink and then automatically opens. In other words it does two things from the one click.

It is setting the HyperlinkAddress property with data from one of the fields on a continuous form.

I just recently dioscovered how to do this so I am like a boy with a new toy:D
 

Users who are viewing this thread

Back
Top Bottom