Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hyperlinks to Files (AXP)

    Hello All,
    I have a database where expense items are stored in a table. Each receipt is stored electronically on a server. I display the expense items in a table view form. What I would like to do is create an interface that would allow the user to "Attach" the file via hyperlink to the record in question. What this will allow for is that anyone else that views that record can see a JPEG of the actual receipt. Does anyone have any good methods to accomplish this?

    Thanks,
    Mark

    Thanks,
    Mark

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

    Re: Hyperlinks to Files (AXP)

    Are the receipts stored as JPEG files? In that case, it is not difficult.

    Method 1:

    Add a Hyperlink field to the relevant table, and store links to the JPEG files in it. The JPEG file will be displayed in whatever application the user has associated with JPEGs (Windows XP Picture Viewer, Internet Browser, IrfanView, ...)

    Method 2:

    Add a text field to the relevant table, and store the path and filename of the JPEG files in it. Use an Image control on a form to display the pictures (you can't do this on a form in datasheet view). Charlotte has posted a demo database that demonstrates how to use an image control for this in <post#=126927>post 126927</post#>.

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlinks to Files (AXP)

    Thanks Hans,
    Well two occurrences I am using have datasheets. The receipt will be stored as JPEG, BMP, or PDF. I am using Citrix server to run the app and the server contains all of the required software to view the file types.

    Thanks,
    Mark

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

    Re: Hyperlinks to Files (AXP)

    Hi Mark,

    If you use datasheets, I recommend either
    <UL><LI>A hyperlink field, as described in my previous reply, or
    <LI>A standard text field containing path+filename, combined with code in the OnDoubleClick event of the text box bound to the field. This code can use Application.FollowHyperlink to simulate the behavior of a hyperlink field, or ShellExecute. A search for either FollowHyperlink or ShellExecute in this forum will yield examples. If you want to provide a user-friendly way to fill the field, you can use the FileDialog object.[/list]HTH

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlinks to Files (AXP)

    Thanks!
    I have entered the hyperlink field in the table and it appears to work pretty well. Yeah, I will need to make some sort of interface for the user to upload the image of the receipt onto the server. I will check out the file dialog feature. Do you know about a way that I could automatically rename the file at the time it is uploaded to the server? What I am talking about here is this:

    The user scans in the paper receipt. He names the JPEG something that makes sense to him. Sometime later, he logs on to the DB and wants to upload his receipts. I would like to use one folder for all receipts (easier to back up and keep track of). Therefore, I need to name the file after the record number in the table, or something like it so that there are no duplicates.

    Thanks,
    Mark

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

    Re: Hyperlinks to Files (AXP)

    You could use the FileDialog object to let the user browse to the JPEG with the provisional name. You could then use the FileCopy instruction to copy the JPEG to the server with a new name based on the record number, and store the new path and filename in the database. Note: if you store a hyperlink, be aware that it has up to three parts: TextToDisplay (what you see), Address (URL or path+filename) and SubAddress (a location within the address, e.g. a bookmark in a Word document, a slide in a Powerpoint presentation, irrelevant for JPEGs.)

Posting Permissions

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