Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Indiana
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    External Document Attacment (2000)

    I've searched the archive of postings to try and figure out my coding problem. Obviously with this posting it means I couldn't find the answer I was looking for. I want the ability to be able to attach external documents to records, on my forms page. Here is what I have done so far:

    1. In the underlying table I added a field for attachment, type hyperlink.
    2. I carried the same field through to the underlying query (the query feed the form)
    3. I have added a command button which opens the "File Open" dialog box, allows me to browse and select the file I wish to attach.
    4. Once selected, the file then is shown in a corresponding control box. So far so good.

    I go through the process of selecting the "attached" file, but when I click on the control (hyperlink) it will not launch the related application and open the corresponding file. I do not get an hour-glass that may indicate it "is thinking about it" either, so I know the failure is somewhere in my programming. For the control box properties, I also set the Is Hyperlink property to yes as well, but it still does work.

    I have located some articles on the MS Knowledge web site for similar problems but they all refer to Data Access Pages being designed for web use. I do not want to go down that path as my database is only used by a couple of people. But the ability to attach one external document to each record is pretty much needed.

    As always I thank you in advance for your assistance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: External Document Attacment (2000)

    Try putting # symbols before and after the filename you get from the File Open dialog. A hyperlink field consists of 3 parts, separated by # symbols:

    DisplayedText#Address#SubAddress

    Of these, only the middle part (Address) is required, the other two are optional.

    DisplayedText is the text shown in the control; if it is absent, the Address is shown.
    Address is the URL or filename.
    SubAddress is the location within the Address to jump to; this can be a bookmark in a Word document, or a cell reference in an Excel workbook, or a database object (form, report, ...) in an Access database.

    In this case, you want to store the filename as Address without specifying a DisplayText and SubAddress, so use something like:

    ' txtLinkField is the text box bound to the hyperlink field.
    ' strFileName is the file name retrieved from the File Open dialog.
    Me.txtLinkField = "#" & strFileName & "#"

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Indiana
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: External Document Attacment (2000)

    Excellent. Thanks Hans. It works great!

Posting Permissions

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