Attachment

K

KBDB

Hi,

I'm trying to add a record to my table that has an attachment field.

I can't figure out where do go from here or even if what I have is correct.

Here is my code:

Private Sub SaveTheRecordClick()
Dim dbs As Database
Dim rst As DAO.Recordset
Dim rstComplex As DAO.Recordset2

Set rst = dbs.OpenRecordset("Current Issues", dbOpenDynaset)
Set rstComplex = Me.Recordset!Attach1.Value

With rst
On Error GoTo Errorhandle2
If rst.EOF Then
If rst.Updatable = True Then

rst.AddNew
rst!Title = Me.Title
rst!Attach1 = ????????????


Can anyone point me in the right direction?

Any help would be great!

Thanks,

Kathleen
 
K

Klatuu

It is not clear what you mean by attachment field. Are you wanting to store
the path to an external document or file? If so, you can use either a text
data type or a hyperlink data type in your table and store the path to the
document.
 
K

KBDB

I have created a field in a table called attach1. (define as attachment) I
have a form that does not use add record as new. (I goto a record) I have
given the user the choice to add an attachment (Word, Excel, PDF, etc.) I
want to write that record back to the table. My problem is that I can not
get at the attachment like I can with the other fields in the table. Even
"Me.xxx" doesn't seem to work. Do I declare this field in the form a
different way? I just made it the field from the table. It seems it is not
part of my OpenRecordset.

I'm not sure how or what to store in this field. It seems the field is made
up of FileName, FileType, FileURL, FileData, FileTimeStamp and FileFlags.

I hope I answer your question.

Kathleen
 
K

Klatuu

Oh, you must be using 2007. Sorry, I don't have that installed here, and I
haven't used it enough to be able to provide an intellegent answer.
 
K

KBDB

Thank you,

Yes, I'm using 2007. I can't seem to find much on this subject. All the
books I've read just breeze right by this topic. It was my hope someone else
found themselves in my position.

Again, Thank you for trying to help me.

Kathleen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top