Adding reports to records as attachments

AdamAA

Registered User.
Local time
Today, 14:55
Joined
Aug 18, 2012
Messages
24
I have an Access 2010 database connected to several SharePoint lists. I'd like to be able to print a report (based on a query) and add that report as a .pdf attachment to the record I was looking at when I generated the report.

At the moment I can save the report as a .pdf to a local file store, then upload it as an attachment, but is there any way to skip that step and add it to the correct record automatically?

Thanks in advance!
 
Hi,

Adding files to a db table will potentially increase size massively and is not normally the 'done thing'.

If you do want to do it you will need a field of type OLEObject and to populate it you will need to copy and paste the file although if you look around you will find this can be done via VBA - sorry, don't have the code myself.

You might be better off having a text field with the path to the .pdf and an event (e.g. double click on filename or buttonclick) which when triggered uses this shell command to open the file.

W = ShellExecute(0, "Open", """" & YourDocFilePath & """", vbNullString, vbNullString, 1)
 
I agree with CJ, if you are planning on storing the Files on the DB, it will lead in unnecessary bloat.. Also, the overhead of coding involved.. So as suggested, create the file to a local drive and store the path..
 
That's great, thanks for the help and advice guys!
 

Users who are viewing this thread

Back
Top Bottom