hello
I have a function that takes a backup of a certain file
but i want this function to run every day at 7 p.m.
how can i do that using VBA?
thanks in advance
hello
I have a function that takes a backup of a certain file
but i want this function to run every day at 7 p.m.
how can i do that using VBA?
thanks in advance
If you are only going to backup a file, why not just use the windows scheduler.
http://support.microsoft.com/kb/308569
but if you want to do it in a form....
the form has the property TIMER INTERVAL...set it to 1000 (its in milliseconds, so 1000 = 1 second) 0 = off
every second that goes by, the property ON TIMER gets called. Your code would go here to trigger the copy.
Code:Private Sub Form_Timer() if TIME() = #7:00 pm# then CopyFiles
Instead of VBA I would use VB Script and the Task Scheduler.
Here is some code you can save as VBS that will copy files and paste them in a destination folder
If you want an Access DB to manage all of the work, you can use task scheduler to open the Access file. My preference is to use VB Script to open Access files but this poster found a way to open Access directly with Task SchedulerCode:Dim sourceFile Dim destinationFile Dim strDesFilName Dim strNow Dim aFSO strNow = Year(Date) & "_" & Month(Date) & "_" & Day(Date) & "_" & Hour(Now) & Minute(Now) & "_" & Second(Now) strDesFilName = "Inv_Copy_" & strNow & ".accdb" destinationFile = "C:\Inventory_Backup\" & strDesFilName sourceFile = "\\SERVERNAME\Folder\FileName.extension" Set aFSO = CreateObject("Scripting.FileSystemObject") aFSO.CopyFile sourceFile, destinationFile
https://www.accessforums.net/access/...pro-42227.html