Save Database With New Name And Then Close

chathag

Registered User.
Local time
Today, 20:50
Joined
May 22, 2009
Messages
32
I have a database called Control.mdb.

A form within control.mdb opens a database called Template.mdb using the following code.

Dim appAccess As Access.Application

Dim dbPath As String

dbPath = "C:\My Documents\Template.mdb"

Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase (dbPath)
appAccess.Visible = True


Once Template.mdb is open I want to save it with a new name and then close it. I have checked out the help section but the save methods only refer to objects within the db i.e. forms, queries etc.

A point in the right direction would be appreciated.

Regards

GC
 
You can use the File System Object and use

FileCopy OldName, NewName

No need to open it to save it under a new name. Question is why?

David
 
I must create databases from a template for approx 20 different departments who do not have access to the shared network. Some of the data is specific to each dept (and highly confidential) so we will create individual stand a lone db's for them.

One final question, can I convert a mdb to an mde using VBA?

GC
 
Firstly, it seams that your organisation does not trust its employees or your IT team is not up to scratch. I ask myself these questions

1. why arn't all departments allowed access to a shared drive
2. what will be achieved by giving departments the same mdb disguised under a different name.
3. Is the application split
4. is there a user login screen
5. is there any role based access control in place
6. is the shared drive on LAN, WAN or wireless
7. if the database is split how does the individual front ends connect to the respective back ends.

Could go on, but enough for now.


David
 

Users who are viewing this thread

Back
Top Bottom