Utlize Attachment field to save a files in a specific shared folder

Alhakeem1977

Registered User.
Local time
Today, 20:27
Joined
Jun 24, 2017
Messages
308
Hi All,

How can I utlize the attachment field to store attachments to a shared drive instead of the access database back end?

My table structure as the below:
Table name: tblDeptReg.
Primary key: PKDes
Ref: short text.
Attachments : attachment

My aim is when a user click a button in data entry form, will sellect the file and it will be stored by default as the [Ref] column and in a specific folder path: A:\Docs.

Thanks in advance!



Sent from my HUAWEI NXT-L29 using Tapatalk
 
Save filepath/name into text field. Attachment type field is not used.

Use Windows FileDialog to allow user to navigate to and select file name.

This is a common topic.
 
Save filepath/name into text field. Attachment type field is not used.

Use Windows FileDialog to allow user to navigate to and select file name.

This is a common topic.
Thanks for your earliest response [emoji106]
I do not know how to use the fileDialog if you could give more explanation but is it can copy the file image or pdf from disktop and past it in a shared folder ( A:\ ) drive?

Sent from my HUAWEI NXT-L29 using Tapatalk
 
Thanks for your earliest response [emoji106]
I do not know how to use the fileDialog if you could give more explanation but is it can copy the file image or pdf from disktop and past it in a shared folder ( A:\ ) drive?

Sent from my HUAWEI NXT-L29 using Tapatalk
Hi. Have a look here. Hope it helps...
 
Use FileDialog to allow user to navigate to and select a file. VBA has intrinsic function to copy files: FileCopy().
 
I can highly recommend this article from Daniel Pineault that shows how you can use the File Dialog.

https://www.devhut.net/2016/10/04/late-binding-the-filedialog/
Thanks for the link you provided [emoji4]

Unfrtuantly, I do not know how to call the function from my form data entry after the user got the sequential ID and rename the file selected as the sequential ID automatically, I prefer to to alter the file view like if it is .pdf (file as usual) with the sequential ID as a barcode on the header of the file ( by the way I have got a vba code to generate the barcode within the database) I do not know if it is possible to get this result?

Awating your prompt response, if you have enough time.

Thanks in advance!

Sent from my HUAWEI NXT-L29 using Tapatalk
 
Well with the function the user selects a file, the function returns the selected file name with path.

So:
strFilename = fdialog(....)

Then you add a new record to your documents table. ID, Filename with Path and possibly an description. It should return the Document ID.

Then you copy the strFilename to a network share location using the File Scripting.Dictionary for example. Something like:
fsoFileCopy(strFilename, strNetworkshare & "/" & lngDocumentID)
 

Users who are viewing this thread

Back
Top Bottom