autoset hyperlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jl2886
    New Member
    • Mar 2007
    • 83

    #1

    autoset hyperlink

    Hello. this command inputs the correct hyperlink for the hyperlink field called "Folder", but when I click on the link it won't bring up the folder. However, if I cut and paste the link back into the same box and click, the link works?
    Code:
    Private Sub Command186_Click()
    Dim Folder
    Folder = "S:\Active Policies 2007\" & Me.LSI_Case_Number & " " & Me.Insured_Name
    Me.Folder = Folder
  • JConsulting
    Recognized Expert Contributor
    • Apr 2007
    • 603

    #2
    Originally posted by jl2886
    Hello. this command inputs the correct hyperlink for the hyperlink field called "Folder", but when I click on the link it won't bring up the folder. However, if I cut and paste the link back into the same box and click, the link works?
    Code:
    Private Sub Command186_Click()
    Dim Folder
    Folder = "S:\Active Policies 2007\" & Me.LSI_Case_Number & " " & Me.Insured_Name
    Me.Folder = Folder
    Two options.

    First...in the on_click event of the field

    followhyperlink me.myfield

    the other option requires you to go into the table and set that field's property to Hyperlink.

    My personal preference, to maintain data integrety, is to use option 1.

    You can change the color and add an underline to the text box on your form so that it has the appearance of a standard hyperlink.

    The followhyperlink function will open up a directory browser if all you use is the Folder path,
    ex: C:\ will open the windows file manager to that drive location

    J

    Comment

    • Denburt
      Recognized Expert Top Contributor
      • Mar 2007
      • 1356

      #3
      Originally posted by jl2886
      Hello. this command inputs the correct hyperlink for the hyperlink field called "Folder", but when I click on the link it won't bring up the folder. However, if I cut and paste the link back into the same box and click, the link works?
      Code:
      Private Sub Command186_Click()
      Dim Folder
      Folder = "S:\Active Policies 2007\" & Me.LSI_Case_Number & " " & Me.Insured_Name
      Me.Folder = Folder
      What is happening is this when you entered it you didn't use the pound symbol but when you pasted it MS Access inserted them for you. I think I did this right my db is tied up at the moment so I am typing off the cuff.

      Code:
      Private Sub Command186_Click()
      Dim Folder
      Folder = "AnyTextIWant#S:\Active Policies 2007\" & Me.LSI_Case_Number & " " & Me.Insured_Name & "#"
      Me.Folder = Folder

      Comment

      Working...