Copying Files Based on Customer ID (1 Viewer)

Learn2010

Registered User.
Local time
Today, 16:20
Joined
Sep 15, 2010
Messages
415
I know a website would solve this problem but Access is the tool at this time. I have a front-end database with a SQL back-end. The user’s front-ends are on a shared S: Drive (\\Hold1\Folder1). The data needs to be used offsite on occasion. Here is the process for when the user goes offsite to meet a customer.

1) The customer record is loaded into the database via their front-end.
2) On the form/sub form I have a button that sends the data to a file on their C: Drive (C:\Hold). This way they can view the data while offsite.
3) Upon return to the office there is a process that allows them to update the customer record if changes were made offsite.

Here is the dilemma. These customer records can have files linked to the records which has relevant information. These linked files are stored on the shared drive as well. All of these files are in folders and the names start with the Customer ID and a brief description. They can also be any type of file; PDF, Word, Excel, etc. For example:

The Customer ID is 12345. This number is in a field on the form (frmMain.frmMainSub). This customer has two linked files in a folder located on the S: Drive in folder \\Hold1\Folder1\Type1. The files are 12345 ABC.pdf and 12345 DEF.doc. When the data for this customer is sent to the C: Drive I need to copy all the customer files to a folder on the C: Drive as well (C:\Hold\LinkFiles). At this time I don’t need to link the files. I just need to get them into that folder.

There are several ways to copy files. How do I get the program to identify the specific customer files and copy them from the S: Drive to the C: Drive?

Thank you.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:20
Joined
May 7, 2009
Messages
19,242
are all files reside in \\Hold\Folder1\Type1 folder?

you can use Dir() to get all the files to a specific
customer by their ID:

const thisFolder As String = "\\Hold\Folder1\Type1"

strFile = Dir(thisFolder & [CustomerID] & "*")
While strFile <> ""
' copy the file here
' ...
' ...
' next file for this customer
strFile = Dir()
Wend
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:20
Joined
May 7, 2009
Messages
19,242
are all files reside in \\Hold\Folder1\Type1 folder?

you can use Dir() to get all the files to a specific
customer by their ID:

const thisFolder As String = "\\Hold\Folder1\Type1"

strFile = Dir(thisFolder & [CustomerID] & "*. *")
While strFile <> ""
' copy the file here
' ...
' ...
' next file for this customer
strFile = Dir()
Wend
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:20
Joined
May 7, 2009
Messages
19,242
Im not on ny pc rightnow. Try searching recursive folder listing here or at the net.
 

Users who are viewing this thread

Top Bottom