Startup

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Can one launch an application using a general module
in the startup properties, or are we restricted to specifying
a form? If so, would there be a better approach than to
launch an invisible form whose open code calls the module
to perform what is desired before the "real" opening form
is launched? (The module's job, in this case, is charged with
the task of determining which form is appropriate.)

Thanks,
Bill
 
Meaning what? The startup property sheet only lists forms
as the initial point of entry to the application. Are you saying
that in the presence of a "autoexec" macro it will actually
receive control "before" the form listed in the property sheet?
I.e., the macro runs first and then whatever is in the property
sheet startup specifications.
Bill
 
Bill said:
Meaning what? The startup property sheet only lists forms
as the initial point of entry to the application. Are you saying
that in the presence of a "autoexec" macro it will actually
receive control "before" the form listed in the property sheet?
I.e., the macro runs first and then whatever is in the property
sheet startup specifications.
Bill

In my testing the startup form is launched and any code in its Open, Load,
and Current events will fire before the AutoExec macro is executed.
 
If I am understanding you correctly, run the code from an autoexec macro (NO
startup form at all) and let the code do it's thing. If it opens a form,
great.

I have built a macro before that opens a different form depending on who is
opening the database. No doce or module was needed, I just did it in the
macro.

Not sure if that answers your question. Hope so.
 
Hi Rick,
By the "that" time, it's too late to change the opening form.
Later today I'll play with an invisible form as the starting
point and invoke a general module from its Open code.
Thanks,
Bill
 
Hi Rick,

Yes, that's exactly what I need. What I don't understand yet is "what
goes in the Startup property sheet" box as the initial form?

Bill
 
Nothing.

Just make an autoexec macro and add a condition (currentuser = John)
(user group = managers) and then the form to open (john's switchboard) or
(manager's menu form).

Add a seaparate line to the macro for each condition.

This macro will run at startup and open the desired form, or perform the
desired action.

In the "Startup..." section on your program, don't open any form. Let your
macro do that.

Rick B
 
If there is an autoexec macro, it runs on startup. It has nothing to do
with the Tools Startup window that lets you specify a form, whether to hide
or show the database window, etc.
 
Great! I'm committed to some other activities for the next several
hours, but I'll implement an autoexec macro and the ensuing code
later today.
Thanks for your help. I'll post back whatever I end up with.
Bill
 
Thanks Matthew, I belive I have the process clear now.
As I've told Rick, I'll post back later with whatever the
final results become.
Bill
 
Bill,

Here is the clear answer:
In your startup properties, leave Display Form/Page blank.
Create a macro named Autoexec.
If it is code in a module you want to run, select the RunCode action. Note
that the code you run must be a function. If it is a sub you want to run,
call the sub from the functioin. It is as simple as that.
 
Thanks Klatuu, I'll put it all together this evening and post back
the final results.
Bill
California, USA
 
Klatuu,
In the AutoExed macro, I specified "RunCode" and in the
function name pane at the bottom of the macro creation/edit
screen I coded ScrRes as the function name. Then, in a
general module I coded:

Public Function ScrRes()
code to run
End Function

Access reports that it can't find ScrRes.

What did I miss?

Bill
 
Bill,

I really don't know. We use it here. In autoexec, we have Runcode and the
function name is (cleaverly) startup(). Did you include the parentheses?
they are required even if you have not arguments to pass.
 
As a follow-up here, I took the collective suggestions
of those that posted a reply. I used the Autoexec macro
to invoke code that obtains the current screen resolutions
to determine which of the two switchboards to use for the
current user's screen settings.

Were it not for the fact that the application's switchboards
are quite static, I would not have been so willing to
accommodate the user's "desires". As Rick pointed out, it
isn't generally reasonable to do form layouts for anything
other than an 800 x 600 monitor setting. In this case, it
wasn't a really big deal.

Thanks to all,
Bill
 
Back
Top