Create an mdb file using VBA?

servoss

Registered User.
Local time
Today, 20:22
Joined
Dec 31, 2002
Messages
46
How do I simply create an mdb file using code? I want to use a transferdatabase command to export data to a table (for import at another time), but this expects a file to exist already.

I've searched with no useful example - perhaps I've missed it, if so, please point in the right direction.

Thanks,
Tom
 
Hello:

RunCommand (acCmdMakeMDEFile)

Should do it. Place this under a command button.

Regards
Mark
 
not so good...

got an error saying I could not open a new MDE with a current database open. Should I put the runcommand() right on the onclick event line - I placed it in the VBS module for the onclick.

Tom
 
This will create a new blank database which you can then export objects to.

Code:
    Dim acApp As Access.Application
    Set acApp = New Access.Application
    acApp.Application.NewCurrentDatabase ("C:\Temp\YourFileNameHere.mdb")
    acApp.Quit
 

Users who are viewing this thread

Back
Top Bottom