Access Command not available

joyequalsdeath

New member
Local time
Today, 06:44
Joined
Aug 6, 2014
Messages
1
Hey all,

So I have spent hours and hours setting up and LMS system and host and blah blah blah.. and no that I have come around to making a student registration database.. I am completely stumped.

I am trying to use the following command:

Private Sub Form_Close()
DoCmd.CopyDatabaseFile _
DatabaseFileName:="C:\Users\Ryan\Documents\StudentAccess.accdb", _
OverwriteExistingFile:=True

End Sub


That is is it's not part of a bigger macro or anything it is straightforward
but when I close the form I get an error

"Microsoft Visual Basic
Run-Time error '2046':
The command or action 'CopyDatabaseFile' isn't available now."


It's driving me mad!!.. any help would be appreciated..

thanks guys
 
Hey all,

So I have spent hours and hours setting up and LMS system and host and blah blah blah.. and no that I have come around to making a student registration database.. I am completely stumped.

I am trying to use the following command:

Private Sub Form_Close()
DoCmd.CopyDatabaseFile _
DatabaseFileName:="C:\Users\Ryan\Documents\StudentAccess.accdb", _
OverwriteExistingFile:=True

End Sub


That is is it's not part of a bigger macro or anything it is straightforward
but when I close the form I get an error

"Microsoft Visual Basic
Run-Time error '2046':
The command or action 'CopyDatabaseFile' isn't available now."


It's driving me mad!!.. any help would be appreciated..

thanks guys

Have you tried:

DoCmd.CopyObject
 

Users who are viewing this thread

Back
Top Bottom