Attachment control - How to use?

  • Thread starter Thread starter sk
  • Start date Start date
S

sk

I am trying to figure out how to use the Attachment control on a form. On
the form, I have a listbox for the user to select a specific record. When an
item is selected, I use Set rst = CurrentDb.OpenRecordset(sql) to open the
record. I then populate the controls on the form with the following
formname.controlname.value=rst!field

I can't figure out how to load the Attachments into the Attachment control.
I tried searching here and online and did not find much outside of using a
bound control. I do not want to use a bound control/form if I can avoid it.

any help or code would be greatly appreciated.
 
I'm not sure why you don't want to use a bound form but I guess you could
extract the file(s) from the attachment
field in the underlying recordset and save them to your hard drive and then
load them into the unbound attachments control.

There are code examples out there, here’s a few:
http://msdn.microsoft.com/en-us/library/bb258184.aspx
http://www.dbforums.com/microsoft-access/1630699-attachment-field-unbound-form-problem.html

If you can't figure it out send me an email and I'll find you the code
needed,
I usually do things the other way, extract files from a bound attachment
field
and save them in the file system so I can use them in email or something
else.

I don't think I ever used an unbound attachments control?
Not sure if there is a way to just assign (without saving to disk and
reading from disk)?
I just never did this so not sure.

HTH,
Mark Andrews
RPT Software
http://www.rptsoftware.com
http://www.donationmanagementsoftware.com
 
Back
Top