Results 1 to 10 of 10
  1. #1
    Outofmyleague is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    5

    Pulling attachments from a Database to a Form

    I am trying to set up a database that will store programs for me. I have an ID, part number, revision, and material for each attachment. I have been trying to come up with a way for a query to pull all related attachments based on the previous criteria.

    Click image for larger version. 

Name:	Program.JPG 
Views:	20 
Size:	78.2 KB 
ID:	24475



    I have been trying to use attachments because each individual program is only 1-2 KB in size. Every line has a single attachment due to the differing number of layers that all of my programs can hold. The goal of this database is to allow our operators to better use their nesting software across multiple orders.
    Click image for larger version. 

Name:	Program-2.JPG 
Views:	20 
Size:	199.7 KB 
ID:	24476

    At this point I have searched google, forums, and had no luck. I'm completely new to access so at this point I'm not even sure if this is something within its capabilities. Any help would be greatly appreciated!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What sort of file is the "Attachment"? .TXT. .DOC...

  3. #3
    Outofmyleague is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    5
    It is a .TXT file and I would just save it as a block of text if there wasn't the possibility of pulling multiple files at once.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Any chance you could post a copy of your db to play with? Strip out any sensitive data of course. Lacking that, how about the SQL for the RecordSource of the form?

  5. #5
    Outofmyleague is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    5
    I wasn't able to directly attach the database here (I assume its a file size issue). I uploaded it to dropbox and have the link below. The attachments I currently put into it were mainly JPG files because those were ones i already had on my desktop that I could attach.

    https://www.dropbox.com/s/73vglhhjw1...ase.accdb?dl=0

  6. #6
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    there's a design issue with your approach; one is a Microsoft issue in that the Attachment field type actually puts the data into the db...it's well meaning but can ultimately bloat your db...

    the next issue is more generic in that typically you don't want to call in attachments unless the person really wants/needs to see it - to avoid bogging it with data exchange - and your design will call in everything into a continuous screen....

    txt files are typically small amounts of data so they wouldn't be nearly as bad as photos of course so.....

    but to do what you are wanting to do you want to use the image control and dynamically call in the path to the image....

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    After looking at the db and understanding your data better, I have to ask why you're not just using a Memo field? It will easily hold 1-2K of text and be much easier to display in a query or on a form.

  8. #8
    Outofmyleague is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    5
    I added pictures to the field because it was a quick way to see if pulling an attachment would work. The reason I am not using a memo field is that I might need to pull up multiple files in one search. My company runs various material combinations throughout the day (the 1018 is one of those). We may have 8 parts that run on one material combination but currently our operators have no way of knowing that without reviewing each part and comparing materials every day. I am trying to create this database so they can enter in part/material information and it will pull up all of the related programs that they can then nest at once. If I set this as a memo field my concern is that if 2+ programs are pulled into one field it would be nearly impossible to determine where one ended and the next began.

    My plan B for this would be to try out setting hyperlinks to folders that have the necessary files. However that would require me to reorganize our filing system which would be quite the undertaking.

  9. #9
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    RGs comment on memo type should be given some thought. The memo field can hold 4k text and one can have more then 1 in a table. If the field count is not excessive then it is a viable approach.

    But if attachments really are needed, and that is pretty common; then I would recommend that you do not call in all attachments just because the main screen/form is active - - particularly for multiple users. Instead offer the attachments as a sub form/table to each main record - that users can look at if they have the need. (Note that a continuous form does not allow sub forms and you would need to change to a single form view.)

    There are a couple ways to implement this. The Hyperlink field type works well and is easy to set up. All your images are in a folder on a common drive.

    An important aspect of this approach is that it relies on the Windows operating system to participate - and that is a good thing; so if the attachment is a pdf it will launch adobe, if it .txt it will launch Notes, etc...it will launch the default application in a separate window outside of the database. You don't want to be attempting to window the attachments inside of the application in general. There are exceptions to this in terms of pics that are record specific and need to display on a report. So my advice is not absolute..but I hope helpful....

  10. #10
    Outofmyleague is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    5
    Thank you very much for the advice! With all of your ideas and advice I finally know how to proceed and can finish this database!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. form not pulling database info
    By Messi in forum Access
    Replies: 6
    Last Post: 07-28-2015, 01:27 PM
  2. Add attachments from database to email
    By Vol71 in forum Access
    Replies: 4
    Last Post: 07-21-2015, 11:09 AM
  3. Proper way to store attachments in a database?
    By alexandervj in forum Access
    Replies: 3
    Last Post: 04-29-2014, 02:52 PM
  4. Viewing Attachments in Access Database
    By RootMason in forum Access
    Replies: 22
    Last Post: 12-12-2013, 10:00 AM
  5. Replies: 5
    Last Post: 10-30-2013, 07:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums