Results 1 to 6 of 6
  1. #1
    nicolareina is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2021
    Posts
    6

    append attachment to another table


    hello forum how do I append attachement in another table with vba?

    running the query gives me this error.
    Click image for larger version. 

Name:	32286_230218_3119.jpg 
Views:	31 
Size:	20.8 KB 
ID:	49791

    help me please!!!

    My project
    esempio.zip

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,936
    Attachments use Recordset2
    Not having used attachments, I would probably add via a recordset if it balks at the query method, though you have not shown your sql code?

    So just a guess really.

    For other members the message appears to be as attached when I tried it.
    Presumably you would need to add all three subfields?

    Might be better just to add the key for that record and attachment in some way?
    Attached Thumbnails Attached Thumbnails attach.PNG  
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    I would guess you need a record set to do it. I don't use them either.

    Are you aware of the pitfalls in using attachment fields? Suggest you google it.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Review https://learn.microsoft.com/en-us/of...chments-in-dao and https://www.access-programmers.co.uk...hments.169056/

    Attachment field is a type of multi-value field but has to be treated differently because data is coming from drive location.

    Also Review https://www.devhut.net/adding-attach...cess-database/
    Last edited by June7; 02-26-2023 at 06:47 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi Nicola

    As suggested by other Forum Members, I would not use attachment fields but use another related table to store the FilePath to
    the specific Documents associated.
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    If you insist in your original quest please have a look at this link from theDBGuy with a sample showing you how to do it:
    http://www.accessmvp.com/thedbguy/de...attachment.php

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 3
    Last Post: 07-01-2020, 01:35 PM
  2. Append Query with an Attachment Field
    By KH Ahmed Bara in forum Queries
    Replies: 0
    Last Post: 04-09-2016, 04:18 AM
  3. Replies: 1
    Last Post: 09-04-2014, 11:10 AM
  4. Replies: 3
    Last Post: 09-21-2013, 09:56 PM
  5. Problem with append query for attachment field
    By ahmadrezaahmad in forum Queries
    Replies: 9
    Last Post: 06-29-2013, 09:08 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