Leave database open

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
What is it you are trying to do?
the OpenCurrentDatabase method makes the mdb file you specify the current
database.
 
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.
 
Back
Top