Solved

Access Attachement Field: Record won't save

Posted on 2013-11-25
3
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Outline Suppose you have some simple text based data in Excel that you would like to display as a PowerPoint presentation. Of course it would be possible to write some fairly complex VBA code that created a new slide for each line of the Excel data…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…

688 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