VBA code gets bypass... help!!! (1 Viewer)

Nishikawa

Registered User.
Local time
Yesterday, 23:18
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
 

CameronM

Registered User.
Local time
Today, 16:18
Joined
Jan 9, 2009
Messages
147
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?
 

Nishikawa

Registered User.
Local time
Yesterday, 23:18
Joined
May 17, 2007
Messages
97
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
 

Nishikawa

Registered User.
Local time
Yesterday, 23:18
Joined
May 17, 2007
Messages
97
I dun think is the code problem. I may have accidentatly disable a functionality in access that caused this problem.
 

DCrake

Remembered
Local time
Today, 07:18
Joined
Jun 8, 2005
Messages
8,626
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

Top Bottom