Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2004
    Posts
    115

    Unanswered: Link file to record, save file name only

    Does anyone have sample DB, (or just the code) to link a file to a record?
    I would like to open the Dialog, select the file, it should save only the file name, and I will hardcode the folder location.

    I prefer it should also work in access 07.

    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can try the code in the attached database and see if it fits your requirements.
    Attached Files Attached Files
    Have a nice day!

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    use a windows common file dialog
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Jan 2004
    Posts
    115
    I appreciate your sample DB. Do you have a sample (with form) that I can select any file, or just PDF?

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    For loading pdf files instead of bitmap files, change:
    Code:
    .FileNameFilter = "Bitmap (*.bmp)" & Chr$(0) & "*.bmp"
    to:
    Code:
    .FileNameFilter = "Portable Document Format (*.pdf)" & Chr$(0) & "*.pdf"
    Have a nice day!

  6. #6
    Join Date
    Jan 2004
    Posts
    115
    Your sample DB, looks like it has a nice piece of code, I'm not so familiar with these functions. Do you have the same DB with a form so I can see which function is called when?

    Thanks

  7. #7
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by Tommiller View Post
    Do you have the same DB with a form so I can see which function is called when?
    Unfortunately not. The sample code I provided is an excerpt from a quite complex project. I just wrote the GetNewPicture procedure to show how the function NewPicture can be used.
    Have a nice day!

Posting Permissions

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