Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Stored Filed Location

Status
Not open for further replies.

naturalsn

Technical User
Apr 26, 2007
68
0
0
GB
Good Day,
I have been scratching around but no luck and hoped someone can adivise we i am going wrong.

I have a form, with a multiselect list box wich list data from my Maps Table with the location of every mapped stored in a field called "MapLoc"

On Double click event I am hoping to open that File in that location,

So double clicking on Record 1 with a location G:|image1.jpg will open Image1 in the current users default image browser. (This is all stored on a nework drive, so location will be same for everyone)

I found the following But no luck, .
Code:
Application.FollowHyperlink "Me.MapLoc"

Is this possible, I would really appreciate any help.

Kind Regards
Sn
 
I think the problem is here; a multiselect list box

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
not really used followhyperlink myself, but have you tried giving it the full path of the file?

"\\ServerName\FolderName\fileName.jpg"

--------------------
Procrastinate Now!
 
HI PHV Canged to just ListBox still not luck,

Crowley thanks for the adivse,

The only problem is i have over a thousand records so a different map per record. So hoped to pick it up from my MapLoc Field, I have not worked with followhyperlink before so no idea.
 
if that followHyperlink thing works, then you can substitute the address string with a dlookup or form reference or whatever...

generally I use FileSystemObject and Shell to do stuff outside of access...

--------------------
Procrastinate Now!
 
Hellow,

Somewhere else in this threaddb i found the following on opening a doc with the associated program:


Make a module and put this code in it

Sub OpenWordDoc(strDocName As String)
Dim objApp As Object

'Opens the document

Set objApp = CreateObject("Word.Application")
objApp.Visible = True
objApp.Documents.Open strDocName
End Sub


attach the following code to a command button for opening the file

Private Sub OpenDoc_Click()
'Check to see that there is a document file path associated with the record
If IsNull(Me.<<fieldname>>) Or Me.<<fieldname>> = "" Then
MsgBox "No document found" & _
"", _
vbInformation, "Action being cancelled"
Exit Sub
Else
'Check that the document specified in the file path is actually there
If (Dir(Me.<<fieldname>>) = "") Then
MsgBox "Document not found", _
vbExclamation, "Action being cancelled"
Exit Sub
Else
'Opens document in Word
Call OpenWordDoc(Me.<<fieldname>>)
End If
End If
End Sub



-Dims

"Wearing sunglasses won't help taking my brightness away"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top