How do I create a hyperlink button on a form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thirdworld
    New Member
    • Sep 2007
    • 25

    How do I create a hyperlink button on a form?

    I'm trying to create a hyperlink button on a form that does the following:

    1. User clicks on button
    2. The default 'insert hyperlink' window appears
    3. User selects the desired file
    4. User clicks ok
    5. Path of the file comes in the textbox

    A button is needed for each textbox that requires a hyperlink. Is this possible? (Note: I'm a beginner with no programming experience and this is my first database.)
  • Briansmi1116
    New Member
    • Oct 2007
    • 76

    #2
    I found this code to work great for what I needed. First you need to create a button then point it to this code.

    Private Sub browse_Click()

    Me.[Hyperlink].SetFocus
    On Error GoTo browse_stop
    RunCommand acCmdInsertHype rlink
    browse_stop:

    End Sub

    This works exactly how you explained you needed.

    Comment

    • Thirdworld
      New Member
      • Sep 2007
      • 25

      #3
      I tried the code and got this error:

      Run-time error '2465':

      System can't find the field 'I' referred to in your expression.

      How can I fix this?

      Comment

      • Briansmi1116
        New Member
        • Oct 2007
        • 76

        #4
        I'm sorry, in the code:

        Private Sub browse_Click()

        Me.[your_location].SetFocus
        On Error GoTo browse_stop
        RunCommand acCmdInsertHype rlink
        browse_stop:

        End Sub

        In your_location, put where you want the link to show up at. My location was called "Hyperlink" .

        Comment

        • Thirdworld
          New Member
          • Sep 2007
          • 25

          #5
          Exactly what I wanted. Thanks man.You have no idea how much you've helped me with your posts.

          Comment

          • Briansmi1116
            New Member
            • Oct 2007
            • 76

            #6
            No problem, I get help I try to help.

            Comment

            Working...