Drag and drop PDF file to MS Access Form

npa3000

Member
Local time
Today, 21:11
Joined
Apr 16, 2021
Messages
36
Hello,

On our company we receive some invoices and at the same time we do 2 things:

1) Pass new record to access ( Id, Amount, supplier name, etc)
2) Save the invoice PDF at a network folder

Is there a way to save the file to the network folder from a drag n drop field in ms access form?

Thanks
 
Drag and drop in Access is a frequent topic. Did you do a search? The answer to your question is probably "no". You can use code in Click event.

Where does invoice PDF come from?
 
Thanks for your answer!

Yes and i couldn't find something.

We receive them via email.
 
Thanks for your answer!

Yes and i couldn't find something.

We receive them via email.
Have you investigated doing this from the email side? If you're using Outlook, for example.
 
Have you investigated doing this from the email side? If you're using Outlook, for example.
Yes, we are using Outlook.

I don't think so that i can do it from there...

Do you have something on your mind that could help?
 
Yes, we are using Outlook.

I don't think so that i can do it from there...

Do you have something on your mind that could help?
I don't have any example handy. See if this one helps...

 
Yes, we are using Outlook.

I don't think so that i can do it from there...

Do you have something on your mind that could help?
I drag and drop outlook attachments all the time?

I have code somewhere that saves all attachments and replaces them with links in the selected emails.

You should be able to adapt that?
 
Last edited:
Hello
Yes you could evaluate dd events in Access, the question where the data comes from (outlook, excel, thunderbird,...) is not the first question, but how deep you want to deal with the problem.
Access itself does not provide any functions for a fully functional dd. But over some control elements a simple dd is possible, like e.g. the web control element, treeview or a listview.
The easiest way is the webcontrol for your requirement, outlook->attach->dd->save in path. Just use the webcontrol to automatically access the desired path, dd from outlook, done. Simple and easy, very little vba-code. Disadvantage is, the webcontrol triggers no usable event at the drop, i.e. an e.g. automated capture into your database or renaming of the file is not possible. Also I don't know now if this webcontrol still exists in the newer access-versions.
 
We receive a lot of drawings and documents. We also have to be able to open any drawing or concerning document from Access.
We have set a rule in saving documents.
For example the drawing AF15687BL101A01 is saved in Y:\\Drawings\A\F\1\ where Y is a network drive.

When entering data in Access, before update of the form checks to see if the Drawing and its relating documents are saved in their correct folder. If not, it gives an error message to correct the saving documents.

After saving the data, any user at any time can click the drawing by double clicking the record in search form.

I'd be glad to see if there's a solution for drag & drop a document into a form.
 
Last edited:
@ npa3000: you might want to have a look at my free utility (http://forestbyte.com/ms-access-utilities/fba-outlook-companion/) that you should be able to easily modify for your needs. If you setup your a shared mailbox for your invoicing emails you can then attach the actual Outlook message to the database record and with a double-click you can open it (in Outlook) with the original attachment in place.

Cheers,
 
UA had some drag and drop stuff years ago, haven't looked at it in a long time though. Can't remember if/what drawbacks it came with.

Anyway, just code your Access function to let the user browse for the item and then handle it from there.

Drag and drop is over-rated. I've been seeing it for 20 years, and yet, even today, when faced with a drag and drop site I never use it, I click Browse anyway, just faster.
 
How does Access know what the "correct" folder is and what the file names are?
As I said there's a rule in place for saving documents and drawing. I think you missed it. Here's a better explanation:

Every saved order in tblOrders has a OrderPK and ProductFK.
If a user is trying to save an order that DrawingNo in tblProducts is AR36598FF203B, before update event of the form checks to see if Y:\Drawings\A\R\3\AR36598FF203B.pdf exists. If that file doesn't exist, then Cancel=True, give the user a message to save the drawing first, and don't save the record.

You have decided that drag and drop is THE solution but what you are describing has nothing to do with drag and drop.
I'm not sure if it's addressed to me or not. If it's to me, I haven't decided anything. I just said if a drag and drop is possible it MAY makes our workflow easier and I'd be glad to hear it, and I didn't offer any solution. I simply explained how we manage our documents.

Maybe you've mistaken me with the OP.
 
Last edited:
Hello again,
most of you are right that I do not explain in detail exactly what I want to do.

Let's start from the beginning.

The company receives via email some PDFs which contain many invoices. Whenever we download and break them so that each PDF is an invoice (For example a PDF can have 4 invoices)

The data of the invoices (Number, Amount, supplier, date, etc.) were then passed to the Access application through a form.

At the same time we save the specific invoice, ie the PDF, in a web folder and the path has to do depending on the year and the week we receive them for example //Server/2022/W1/1234.pdf


So I wonder if there is a way after I have saved the invoice data in Access to create a drag n drop field so that the user drags the PDF from his desktop and based on the invoice data the path is created and stored there with correct name (I say the name because usually when we split a large pdf into many small ones they have random names).

What do you think ?
 
When I split my incoming pdf into separate invoices I use an app from the MS store.
When I save the original pdf, let's say LBS 150222 Invoice.pdf, the app splits the pages into
LBS 150222 Invoice Page 1.pdf
LBS 150222 Invoice Page 2.pdf


You could just let them enter the path of the original files in the DB, then move them to your relevant folder renaming and changing the path in the db as you do so?

So I select c:\temp\LBS 1502 Invoice Page 1.pdf for a record
When finished I press a button, and the file is moved from c:\temp to //Server/2022/W1/WhateverTheinvoiceNumberIs.pdf and then changes the filepath in the db to reflect the new location and name?
 

Users who are viewing this thread

Back
Top Bottom