Solved

Access Attachement Field: Record won't save

Posted on 2013-11-25
3
255 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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

809 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