Leave database open


G

Guest

I use the following statement several times in my code:

'open the master database
Set accessapp = CreateObject("Access.Application")
accessapp.OpenCurrentDatabase ISSUEMASTER

Can I move these to a public sub:

Public Sub OPEN_ISSUETRACK()

'open the master database
Set accessapp = CreateObject("Access.Application")
accessapp.OpenCurrentDatabase ISSUEMASTER

End Sub

and then reference from another sub like this?

Call OPEN_ISSUETRACK

accessapp.run "export_rpts"

Or will the accessapp close at the end of the first sub?
 
Ad

Advertisements

G

Guest

What is it you are trying to do?
the OpenCurrentDatabase method makes the mdb file you specify the current
database.
 
G

Guest

I run a series of backup procedures from one database upon another database.
I have done some testing, and moving this open to a public sub that can be
called from different procedures seems to work.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top