Use vb line to copy a dbf file to another location

  • Thread starter Thread starter mj
  • Start date Start date
M

mj

Hi. Any suggestions for this would be a big help. I have
dbf file that I link to my Access application. The dbf is
a download that takes place every morning. It's pretty
big, so I put it on my C drive to make accessing it a
little faster. I was hoping to also copy it to a network
drive so that some other people can access it.

Right now it's at C:\Data\Shipped.dbf

I'm hoping to put some vb behind my form that will copy it
to M:\Data\Shipped.dbf. The code would look something like
this:

Private Sub Form_Timer()
Me.Clock = Format(Now, "h:nn:ss AM/PM")
If Me.Clock = "6:00:00 AM" Then
[COPY FILE FROM C:\Data\Shipped.dbf TO M:\Data\Shipped.dbf]
End If
End Sub

Any thoughts? Thanks!!
 
The following should do the copy job for you:

FileCopy "C:\Data\Shipped.dbf", "M:\Data\Shipped.dbf"
 
That worked great! Thank you!!!
-----Original Message-----
The following should do the copy job for you:

FileCopy "C:\Data\Shipped.dbf", "M:\Data\Shipped.dbf"



--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Hi. Any suggestions for this would be a big help. I have
dbf file that I link to my Access application. The dbf is
a download that takes place every morning. It's pretty
big, so I put it on my C drive to make accessing it a
little faster. I was hoping to also copy it to a network
drive so that some other people can access it.

Right now it's at C:\Data\Shipped.dbf

I'm hoping to put some vb behind my form that will copy it
to M:\Data\Shipped.dbf. The code would look something like
this:

Private Sub Form_Timer()
Me.Clock = Format(Now, "h:nn:ss AM/PM")
If Me.Clock = "6:00:00 AM" Then
[COPY FILE FROM C:\Data\Shipped.dbf TO M:\Data\Shipped.dbf]
End If
End Sub

Any thoughts? Thanks!!


.
 
Back
Top