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!

Network Directory on Shared dbase

Status
Not open for further replies.

28642864

Technical User
Mar 27, 2008
6
0
0
US
I have a text control field that puts a hypertext link to a files (PDF, website, etc) for specific records. It works perfectly, but the issue is the dbase sits on the network and network drive mapping is different for users. The documents and images I use are the same folder but drive letters is mostly the issue.

Any suggestion on correcting this issue?
Thanks
 
Instead of saving "F:\Path\Filename.ext", save \\servername\Path\Filename.ext" (I think this is called the URL, but not sure of that), that way the link is not dependant on drive letter mappings

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Ken,
I use the following code. I browse to add the path to the text field Sitelink. Is there a way to automate the path on the search instead of typing the \\server\path\filenane?

Thanks


Private Sub Sitelink_Click()
Me.Sitelink = Nz(Me.Sitelink, "")

If Me.Sitelink = "" Then
MsgBox "Add Image by Clicking on Button!"
Else
Call fHandleFile(Me.Sitelink, WIN_NORMAL)
End If

End Sub
 
The image on the path is suppose to go into a image frame. I have this module that does this. I tried to just type in the text on the server address \\hiiserv1\acq\image\filename and it didn't work to display in the image frame per the module code below. I also have a hypertext filed which i typed the path in and didn't work. Any advice is appreciated.

MODULE CODE for IMAGEFRAME

Public Function DisplayImage(ctlImageControl As Control, strImagePath As Variant) As String
On Error GoTo Err_DisplayImage

Dim strResult As String
Dim strDatabasePath As String
Dim intSlashLocation As Integer

With ctlImageControl
If IsNull(strImagePath) Then
.Visible = False
strResult = "No image name specified."
Else
If InStr(1, strImagePath, "\") = 0 Then
' Path is relative
strDatabasePath = CurrentProject.FullName
intSlashLocation = InStrRev(strDatabasePath, "\", Len(strDatabasePath))
strDatabasePath = Left(strDatabasePath, intSlashLocation)
strImagePath = strDatabasePath & strImagePath
End If
.Visible = True
.Picture = strImagePath
strResult = "Image found and displayed."
End If
End With

Exit_DisplayImage:
DisplayImage = strResult
Exit Function

Err_DisplayImage:
Select Case Err.Number
Case 2220 ' Can't find the picture.
ctlImageControl.Visible = False
strResult = "Can't find image in the specified name."
Resume Exit_DisplayImage:
Case Else ' Some other error.
MsgBox Err.Number & " " & Err.Description
strResult = "An error occurred displaying image."
Resume Exit_DisplayImage:
End Select
End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top