Results 1 to 5 of 5
  1. #1
    cjp78 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    3

    Attachments

    How can I limit the number of attachments per record to one?

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Maybe I'm just displaying my ignorance of some of the new features of Access 2007, but what do you mean the "number of attachments per Record"?

    Are you talking about enforcing a one-to-one Relationship between two tables?

  3. #3
    cjp78 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    3
    Quote Originally Posted by cjp78 View Post
    How can I limit the number of attachments per record to one?
    Thanks for taking the time to look at my problem and reply. 2007 supports attachments (text files, pictures etc) being added to a record. The default setting allows multiple attachments per record (ie row in a table). I know this breaks RDB rules of one value per column, but access handles this in a behind the scenes table(s) that is not user accessable. However I want to limit the user to a single attachment only for each record, making sure older attachments are deleted on update.

  4. #4
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Well, in that case, I'd say do it the old way. I'm almost positive there's a way to do what you're asking using Access 2007's builtin capabilities, but it'd probably just be easier to take control of attachments yourself.

    Honestly, the best way to handle attachments is to store them outside the database and just create a text field that holds a link to their location. Then, whenever someone adds a new attachment, you just delete the old one and replace the link.

    If you want to do everything in Access though, you can also add a field to each Record with a type of "OLE Object" and insert the attachment in there. Adding files in the database like that though generally isn't recommended because it can add a huge amount of bloat to your database (what if someone attaches a 5mb JPG to each of your records?).

    Actually, probably the best way would be to have a table for just the OLE Objects. Give it maybe three fields per Record, a unique ID, the OLE Object field and a Text field where the user adds a brief description. Then add a field to your other table with a reference to the ID. That way, you can "link" the same attachment to multiple records without having to store it multiple times.

  5. #5
    cjp78 is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    3
    Rawb, thanks. I've come to the same conclusion unfortunately....back to VB...

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

Similar Threads

  1. Append records with attachments
    By Dawie Theron in forum Queries
    Replies: 1
    Last Post: 01-22-2010, 06:19 AM
  2. list attachments in form
    By hawaiikim in forum Forms
    Replies: 0
    Last Post: 08-24-2009, 11:08 AM
  3. attachments in access 2007
    By barbhall in forum Forms
    Replies: 0
    Last Post: 08-11-2009, 01:12 PM
  4. locking pathways for attachments
    By highland in forum Access
    Replies: 0
    Last Post: 07-26-2009, 06:37 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