Solved

Access Attachement Field: Record won't save

Posted on 2013-11-25
3
234 Views
Last Modified: 2013-12-01
I have a single table with names and addresses.  I have a simple for that allows me to add new records and to save them.  This all worked until I added an Attachment field to the table.  I can add attachments to existing records.  I can add records to the table.  BUT when I add a new record to the table via the Form (I can see the record is there, the autonumber populates), when I try to save the record via me.requery or acCmdSaveRecord, the record is lost.  If I remove the Attachment field from the table, then the form works again.

What am I missing?  Many thanks for your wisdom.
0
Comment
Question by:4GvnNot4Gotn
  • 2
3 Comments
 
LVL 21
ID: 39675193
It would help to now the version of Access including SP level?

If Access 2007, make sure you have the Office SP2 update installed.

Do you have any VBA code in the form's Before Insert event?

FWIW: I contumely run into issues with the Attachment data type. I find it best to avoid them.
0
 

Author Comment

by:4GvnNot4Gotn
ID: 39678130
I am getting the same results on both my Access 2007 and Access 2013 machines.  Both machines have all the Office updates installed.

There is no code in the BeforeInsert, only code in the AfterInsert.  In the AfterInsert I refresh a listbox so the user can see the record added.

Very strange.  A friend says he always puts attachment fields in a joined table.  You have to use a subform to view the data but by keeping the attachment field separate from the parent record, he says you can avoid a number of issues.  Without a better solution I may try that.
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 39679411
I do lots of document management tasks in Access. I attach files to records a lot. I use a separate table also. Each record has a single file path. I store the full path as text. Hyperlinks are a lot harder to work with. By using just plain text to store the path this method also works well with other database type as the back end. I have been able to use it with server different  SQL Servers.

I have created this example:
Document Links 2 (Click Here)
This is an update to the basic example of how to store the path to a file and also be able to view the file. You can browse using the standards windows common dialog to select the file. You can view the file using the application defined with the Windows File Associations. It uses the ShelExec API to open the file. It does not use the .Followhyperlink  method.

This example is a continuous form that could easily be used as a sub form to attach multiple documents to a record.

***** Because it doesn't use the hyperlink data type, this new version stores the path in a way that allows the folder to be easily moved.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Workbook sharing 3 33
How do I delete duplicate google calendars? 3 33
Exchange 2010 4 30
VBA MS Word "Table of Contents" extractor` 4 23
Photo Albums in PowerPoint Photo Albums are a very useful tool in PowerPoint and allow you quickly add a large number of images. The images can be formatted in a variety of ways so that you are able to create a professional looking presentation v…
With the internet and the ease of information transference, many professional jobs can be done anywhere today.  Why should it make a difference whether an x-ray is read in India or the United States as long as the radiologist is qualified?   Outso…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now