S
Steven
I have the following code that runs when this Database
starts. It is called from the OnOpen event of a form that
opens when the Database starts. This Sub's function is to
open another database and then close. I am doing this
because the other database is password protected.
Sub OpenAnotherDB()
Static acc As Access.Application
Dim db As DAO.Database
Dim strDbName As String
strDbName = "C:\TestArea\NewTestFile.mdb"
Set acc = New Access.Application
acc.Visible = True
Set db = acc.DBEngine.OpenDatabase(strDbName, False,
False,";PWD = NewTestFilePW")
acc.OpenCurrentDatabase strDbName
db.Close
Set db = Nothing
db0001.CloseDB '<-THIS IS THE QUESTION.
End Sub
My question is the db0001.CloseDB
If I type db0001. then many choices appear and I choose
CloseDB in this case. Why does it recognize the db0001.?
If I copy this Sub routine to another program it does not
recognize the db0001 and when I compile the module it will
error saying the db0001 does not exist. Why does it
exists in this file? Is there something else I am doing
that I do not realize?
Note: I would give better information here but I cant
because I dont really understand what is happening.
Thank you for your help.
Steven
starts. It is called from the OnOpen event of a form that
opens when the Database starts. This Sub's function is to
open another database and then close. I am doing this
because the other database is password protected.
Sub OpenAnotherDB()
Static acc As Access.Application
Dim db As DAO.Database
Dim strDbName As String
strDbName = "C:\TestArea\NewTestFile.mdb"
Set acc = New Access.Application
acc.Visible = True
Set db = acc.DBEngine.OpenDatabase(strDbName, False,
False,";PWD = NewTestFilePW")
acc.OpenCurrentDatabase strDbName
db.Close
Set db = Nothing
db0001.CloseDB '<-THIS IS THE QUESTION.
End Sub
My question is the db0001.CloseDB
If I type db0001. then many choices appear and I choose
CloseDB in this case. Why does it recognize the db0001.?
If I copy this Sub routine to another program it does not
recognize the db0001 and when I compile the module it will
error saying the db0001 does not exist. Why does it
exists in this file? Is there something else I am doing
that I do not realize?
Note: I would give better information here but I cant
because I dont really understand what is happening.
Thank you for your help.
Steven