IsLoaded in Another Database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two db's. I need the first one to check and see if the second one has
a certain form loaded and, if not, to load it. I have the second db as a
reference in the first db but can't figure the syntax to query the second db
to see if the form is loaded... then, if it's not, how to open it from the
first db.

Thanks ... you guys are GREAT!
 
Using reference, db1 won't recognize the forms/reports/macro/query/tables in
db2, it will recognize functions that are located in modules in db2.

So, create a function in db2 that open the form
Function OpenMyForm()
Docmd.OpenForm "FormName"
End Function

In the db1 run the code that check if the form is loaded, and if not run the
function that opens the form

If Not IsLoaded("FormName") Then
OpenMyForm
End If
 
This isn't giving me the result I need. It appears that when I call the
function in the second db from the first db I wind up with the form opening
in the first db. When that forms calls the functions in the second db I get
errors that the forms and tables in the second db aren't found. Apparently,
the function called from the other db is trying to work with the objects in
the current db.

The Process db reads a spreadsheet on the network every fifteen minutes and
updates its tables. This process is driven by a form timer so the Process db
must be opened (the form auto loads) to do the processing. The Working db has
those tables as linked to it but if the Process db isn't running then the
tables are never refreshed from the spreadsheet. It is important that the
Process db is always open when the Working db is running so the updates can
occur.

I need to figure out a way to determine if the form is loaded in the Process
db and if not, invoke it IN the Process db. The IsLoaded function works but,
as I said, if it needs to load, the current process loads it in the Working
db....
 
Back
Top