Results 1 to 11 of 11

Thread: hyperlinking

  1. #1
    Join Date
    Jun 2004
    Posts
    30

    Angry Unanswered: hyperlinking

    I have a database with a table, the table has attributes for documentation, and one of the fields I have storing the location of the document. The other significant field I have set in the table is the document name. I then create a join table to enable a many to many relationship between the documentation table and another table. What I want the user to see when they look at the table or subsequent form is the name of the documentation. This works, in that I have it tied to the primary key and I can see the table name well enough, but I want to make it so that when you click on the name in a form it will open up the document recorded in the location field. That is the ideal solution for me. I dont know how to do this...but then I decided to try giving the name field a hypertext link property in the table and then implementing it in the form. But when this is done, it just flat out refuses to work, the hand comes up but it doesnt go anywhere, and if I right click the hyperlink option is grayed out. Can anyone help me?

  2. #2
    Join Date
    Jul 2004
    Posts
    10
    Where are the documents being stored? On a file server that everyone has access to? When storing the location, be sure to store the file path like \\server1\folder\Document.doc

    If you store the location like above, the hyperlink feature should work for everyone. You might have to code the hyperlink using VBA and a label's On Click event.

  3. #3
    Join Date
    Jun 2004
    Posts
    30
    Its not a matter of an incorrect file location or it not being accessable from some computers, its that when you click on the link in a form made from a join table comprising of a tables primary id key, the hyperlinked name refuses to execute...the colour is hyperlink, the hand is a hyperlinked hand, but you click on it and nothing happens, and you right click on it and editing the hyperlink option is not an option. How would I go about hyperlinking with vba? do you have any links?

  4. #4
    Join Date
    Jul 2004
    Posts
    10
    Create a label and I will call it OpenDoc. The reason for this is that the textbox does not have very good hyperlink properties. I have not had good luck with it anyway. If you have a textbox that displays the file location you can use that info.

    In the labels OnClick event, you will either use your textbox that has the file location, or write a SQL statement to extract the file location from the table. Then you can type this Me.OpenDoc.HyperlinkAddress = and then your file location weather you use a textbox or a SQL query to get that location.

    Example:
    I have a textbox with the file location displayed called FileLoc that is stored in my table. Here is my code that opens an Excel document when I click the label OpenDoc

    Private Sub OpenDoc_Click()
    Me.OpenDoc.HyperlinkAddress = FileLoc
    End Sub


    Does this help?

  5. #5
    Join Date
    Jun 2004
    Posts
    30
    It helps somewhat, but I am so inexperienced with this I think there is more than you assume I know but I dont. I seem to have screwed up this statement in some way, here is the code:

    Code:
    Private Sub DocumentationID_Click()
    Me.DocumentationID.Hyperlink = "SELECT Documentation.FileLocation"
    End Sub
    Do you have any idea what the problem is? Thank you for your help so far.

  6. #6
    Join Date
    Jul 2004
    Posts
    10
    No problem. Let me ask a question.

    Do you display the file location on your form in a textbox? If so, what is the Name of the textbox.

    If not, what is the table name and field name of the file location information.

  7. #7
    Join Date
    Jun 2004
    Posts
    30
    No problem. Let me ask a question.

    Do you display the file location on your form in a textbox? If so, what is the Name of the textbox.

    If not, what is the table name and field name of the file location information.
    I dont display the file location of the form in a text box on the form. The table and field name for the location where the location or webpage that the file is stored is:

    Documentation.FileLocation

    The readable text in the textbox is Documentation.Name
    The bound column is documentation.DocumentationID

    So I would like the bound column to be documentationID, the text to display Documentation.Name and to have documentation.name hyperlinked with documentation.filelocation as the source page. I hope this helps clear it up.

  8. #8
    Join Date
    Jul 2004
    Posts
    10
    ok. I hope this helps. I have creadted a quick database for you. One thing is that the Micrsoft DAO 3.6 Object Library must be checked. Goto the VBA IDE and goto Tools-->References to check.

    Like I said earlier, the textbox can not have a hyperlink address assigned on the fly. So I created a label and made it look like a button. I know the code is rough, but I did it real quick and did my best to comment the code to help you understand what I did.

    Of course you will not be able to open the files you see in my table, as I did not attach them.

    I hope this explains alittle better.
    Attached Files Attached Files

  9. #9
    Join Date
    Jun 2004
    Posts
    30
    Thank you for all your help, I am still having a problem, I read the code and changed it to fit my situation and it gives me an error. I have uploaded a sample i extracted from my main database that shows the problem I am having. The form in the sample database serves as a subform to another form I have, but it should not introduce extra complexity to the problem. I hope creating this helps save you time from the excellent help that I so much appreciate so far.
    Attached Files Attached Files

  10. #10
    Join Date
    Jun 2004
    Posts
    30
    Myself and a couple others in the office found a fix for the problems we had, and suffice it to say Microsoft is EVIL! But at least it works now...thanks for your help man

  11. #11
    Join Date
    Jul 2004
    Posts
    10
    Glad you got it working. I did not know you were doing a sub form. The way around that is to use a command button instead of the label. I was going to attach the fix, but sounds like you are ok.

Posting Permissions

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