Attachment in Access 07

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
'm trying to add Attachment fiels in form which when click i want it to be transfered to the table in other database....
Does vba/query transfer the attachement to the table field?
Is this possible?


Thanks in advance for helping....
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
The attachment will be stored in whatever database the underlying table is in. If the form is linked to a table in Database1 then the attachment is stored in Database1 ... if the form is linked to a table in Database2, then Database2, and so on.

Be careful as attachments (such as PDF's or images) can easily use up a lot of disk space.
 
Upvote 0
Xen, thanks alot for confirmning
if i face any problems then 'll get back tonight:)
Thanks again...
 
Upvote 0
Could you please show me 1 example of how i can transfer the attachement from form to table in different database...


Thanks in advance again.:)
 
Upvote 0
I'm afraid I've never worked with attachments in Access.

Are you saying you have the attachment already saved in Database1 and you want to put it in Database2 instead? (Normally that wouldn't be necessary - just link the table in Database1 to Database2).

Or is this the first time you are saving the attachment? In that case just bind the form field to the table that has the attachment field.

ξ
 
Upvote 0
Xen, thanks again for replying....i want to do anything that is possible...
Should i first transfer the attachement to table that is in this database and then transfer whatever is here in this database to the other database?

if i link the database....'m not sure how that works in access....


Suppose if i link the 2 database table2 to current database table1 will table2 get updated by itself when i update table1 one here?

and if i detele anything to linked table will it also delete that is in main table that is table2


Thanks agian for helping....


I'm afraid I've never worked with attachments in Access.


Are you saying you have the attachment already saved in Database1 and you want to put it in Database2 instead? (Normally that wouldn't be necessary - just link the table in Database1 to Database2).

Or is this the first time you are saving the attachment? In that case just bind the form field to the table that has the attachment field.

ξ

 
Upvote 0
if i link the database....'m not sure how that works in access....

In Access when you "link" this is normally referring to creating a linked table in a front end database to a table in a back end database. In the front end you case use the linked table just like a local table. This means you can created a bound form or report to the linked table.

This may help: Splitting your Access database into application and data



Suppose if i link the 2 database table2 to current database table1 will table2 get updated by itself when i update table1 one here?

In Access you do not linked tables together between databases. You link tables to a database.
 
Upvote 0
Right. generally speaking, a linked table is just like a local table in your database.
 
Upvote 0
What does child recordset mean?
and FileData, Pictures mean?

http://msdn.microsoft.com/en-us/library/bb257442(v=office.12).aspx

Code:
[FONT=Courier New] '  Instantiate the parent recordset. [/FONT]
[FONT=Courier New]  Set rsEmployees = db.OpenRecordset("Employees")[/FONT]
 
[FONT=Courier New]  … Code to move to desired employee[/FONT]
 
[FONT=Courier New]  ' Activate edit mode.[/FONT]
[FONT=Courier New]  rsEmployees.Edit[/FONT]
 
[FONT=Courier New]  ' Instantiate the child recordset.[/FONT]
[FONT=Courier New]  Set rsPictures = rsEmployees.Fields("Pictures").Value [/FONT]
 
[FONT=Courier New]  ' Add a new attachment.[/FONT]
[FONT=Courier New]  rsPictures.AddNew[/FONT]
[FONT=Courier New]  rsPictures.Fields("FileData").LoadFromFile "EmpPhoto39392.jpg"[/FONT]
[FONT=Courier New]  rsPictures.Update[/FONT]
 
[FONT=Courier New]  ' Update the parent record[/FONT]
[FONT=Courier New]  rsEmployees.Update[/FONT]
 
Upvote 0
hmm, where did that code come from ...

I *think* however, that the an attachment is stored in a system table that Access keeps track of ... so the child recordset must be the records in the table that *actually* stores the pictures .... which you get to through the field.

Just a guess on my part though.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top