VBA code gets bypass... help!!!

Nishikawa

Registered User.
Local time
Today, 14:20
Joined
May 17, 2007
Messages
97
Hi,

all of my vba code that I have programmed is not excuted. MS access just run through it without doing anything.

Has anyone experienced this before?

This is one of my sample code. Even if I "Step into" (F8) my code slowly, it does not work. Did I accidentately disable something?

Please help!!! :(


Code:
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile orginpath, newpath
Set fs = Nothing
 
When is the code snippet meant to run? You didn't include the function or sub declaration in your post. Is it triggered by a button click, or in a stand-alone module?
 
sorry. Here is what is happening. the code used to work for the last 2 years. It just stop working suddenly.

Sub test()
Call CriticalBackUps(DatabaseSource & "\" & RawData, DatabaseBackup & "\" & Data)
End Sub


Function CriticalBackUps(ByVal orginpath As String, ByVal newpath As String)
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile orginpath, newpath
Set fs = Nothing
End Function
 
I dun think is the code problem. I may have accidentatly disable a functionality in access that caused this problem.
 
What is contained in DatabaseSource and DatabaseBackup

Have you checked that the source and destination folders actually exist.

David
 

Users who are viewing this thread

Back
Top Bottom