Results 1 to 2 of 2

Thread: path problem

  1. #1
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80

    Post Unanswered: path problem

    I used API call to open up a file dialog window, where you can choose a file and the path to it is stored in a hidden text box.

    My problem is that the path is stored this way: "C:\MyFolder\MyPics\MyPic1.jpg" and it should be like this: "..\MyPics\MyPic1.jpg", so that they can be displayed even if someone saves the database in different location.

    This is the code that gets the picture path:

    Function FndFile()
    Dim strFilter As String
    Dim strDefaultPath As String

    strDefaultPath = Application.CurrentProject.Path
    Me.txtPicPath = GetOpenFile(strDefaultPath, "Find Picture..")
    SetPicPath
    End Function

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    Paiva

    you could try finding the MyPics part of the default directory with InStr and concatonate everything after it to the ..\

    X = "..\" & mid(strDefaultPath,instr(strDefaultPath, "MyPics")-1)

    This should let you get the value you want into that hidden text field

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •