calling function in another DB

J

Jim Burke in Novi

I am calling a function that is in another database. Is there a way for me,
in the called DB, to detect that the database is being opened because of a
remote call?
 
S

Stefan Hoffmann

hi Jim,
I am calling a function that is in another database. Is there a way for me,
in the called DB, to detect that the database is being opened because of a
remote call?
Not really. But you may compare CurrentDb and CodeDb, they should be
different in your case.


mfG
--> stefan <--
 
S

Stuart McCall

Jim Burke in Novi said:
I am calling a function that is in another database. Is there a way for me,
in the called DB, to detect that the database is being opened because of a
remote call?

If the function (or a wrapper for just this purpose) is never called from
the called db, then you know it's been called remotely.
 
J

Jim Burke in Novi

Here's my problem. In the called DB, I have a splash screen that is used as a
startup screen. When I'm running in development mode I don't have a startup
screen specified. When I put the appl into production I always go to tools,
options and specify a startup. When I call the remote DB I hide the called
instance of Access. In test mode this works fine - the module executes, and
the user never sees anything. In production mode the splash does not get
displayed, which is what I want. but in my splash screen Load event I open a
login form, and for some reason this form gets displayed. This happens before
the function gets executed. I don't want this to happen - I want to bypass
the login form and just execute the function. I realize that I can assume the
function was called remotely, but this form gets displayed before the
function is run, and I don't want the user to have to do anything once
they've clicked the button that calls the remote function. As it stands they
get presented with this login screen. Once that is done, nothing more is
displayed - the function runs and that 'hidden' instance of Access is closed.
 
S

Stuart McCall

Jim Burke in Novi said:
Here's my problem. In the called DB, I have a splash screen that is used
as a
startup screen. When I'm running in development mode I don't have a
startup
screen specified. When I put the appl into production I always go to
tools,
options and specify a startup. When I call the remote DB I hide the called
instance of Access. In test mode this works fine - the module executes,
and
the user never sees anything. In production mode the splash does not get
displayed, which is what I want. but in my splash screen Load event I open
a
login form, and for some reason this form gets displayed. This happens
before
the function gets executed. I don't want this to happen - I want to bypass
the login form and just execute the function. I realize that I can assume
the
function was called remotely, but this form gets displayed before the
function is run, and I don't want the user to have to do anything once
they've clicked the button that calls the remote function. As it stands
they
get presented with this login screen. Once that is done, nothing more is
displayed - the function runs and that 'hidden' instance of Access is
closed.

Try creating a public function in a standard module that is called from an
Autoexec macro (via the RunCode Action). This function should test the
Application.UserControl property to decide what to do (look up UserControl
in the help for more info). If the app was started remotely, UserControl
will be False, so don't open forms etc. If it's True, continue as normal.

Oh, and don't forget to clear the "Display Form/Page" option in Tools |
Startup.
 
J

Jim Burke in Novi

Application.UserControl is exactly what I needed. Works like a charm. Thanks.
 

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