Path from network drive in image pull

pat_nospam

Registered User.
Local time
Today, 02:19
Joined
Oct 14, 2003
Messages
151
I'm using the following code to resolve my paths for loading images into an unbound field for display.

Code:
Private Function GetPathPart() As String
    ' Comments  : Returns the path part of a string
    ' Parameters: strPath - string to parse
    ' Returns   : path part
    '
    
    Dim strPath As String
    Dim intCounter As Integer
    
    Set db = CurrentDb
    strPath = db.Name
    db.Close
    Set db = Nothing
        
    For intCounter = Len(strPath) To 1 Step -1
        If Mid$(strPath, intCounter, 1) = "\" Then
            Exit For
        End If
    Next intCounter
    
    GetPathPart = Left$(strPath, intCounter)

End Function

Of course, with this it always looks beneath the directory in which the database is. How can I modify this to look on the F:\ drive instead of the C:\Where\AccessDatabaseIs\

Thanks in advance! :)
 
This line:
strPath = db.Name
is settings the strPath variable to the path and filename where you db was loaded from. If you want it to point to "F:\" instead, just replace db.Name with "F:\".

Of course then the function becomes extraneous.
 

Users who are viewing this thread

Back
Top Bottom