Ok, I have a user form thats used to add data to a table (obviously!) but I have been asked is it possible to be able to attach a PDF file via the user form so that it is also added to the table??
Hope you can help as it's driving me
Ok, I have a user form thats used to add data to a table (obviously!) but I have been asked is it possible to be able to attach a PDF file via the user form so that it is also added to the table??
Hope you can help as it's driving me
Not really sure what you are asking. But if you mean have a field in your table that can contain a PDF file, the answer is yes. Define the field as a binary/OLE Object and use an ADODB.Stream Object to insert a selected PDF into the field. If you mean be able to display the PDF within an Access form, I'm not so sure - probably requires full version of Adobe, whereas with the other method you can just export out of the field to a file and use ShellExecute().
.02
Stan
Hi Stan,
I'm not particulary wanting to view the PDF in the user form, I can do that with a report, what I would like is to have something on the user form to enable me to add a PDF to a table field as easily as a text box allows me to add text to a field.
You mentioned, ADODB.Stream Object to insert a selected PDF into the field, could you expand on this please?
Does that make anymore sense?? I hope so !! Sorry my previous ramble didn't!!
Either way, you're talking about an embedded link, whereas the Stream will insert the entire PDF document as Binary. However, I use Streams a lot and normally include a 'Button' on my form which says "Click To Add" [PDF/XLS/XML/JPEG... whatever] - then I process the click event by popping up the Windows common control with a filemask, verify a file selected then something likeOriginally Posted by BexleyManor
But I am still confused over how you want the file stored as opposed to how it is displayed. Stan'assume file selected is cPDF 'assume Access Field is Binary/OLE type named MyPDF S = CreateObject("ADODB.Stream") S.Type = 1 'binary stream S.Open() S.LoadFromFile(cPDF) oRS.Fields("MyPDF").Value = S.Read(-1) S.Close()
I never embed files. I grab the file and save the link to a table. I use the PDF activeX control to them load the file. If this is what you want to do, let me know and I'll help.
Bones
Hi Bones, I got dragged away on something else in the office so this is my first chance back at this topic.
Yes, what you suggest sound interesting and I presume less 'database swelling' than piling them into a table.
I'd love to hear what you suggest, sounds very interesting.
I'll put together a sample for you. Giveme a day or two ok.
Bones
make a folder call "images" in the same folder where the database is.
take a look a this. Any question, just ask.
Last edited by boneKrusher; 06-03-2006 at 05:02 AM.