A few things to consider:
1) Show the form _before_ you start all this (with Me.Show, or similar).
That'll get the form up quickly, and give the user something to look at
while the form is initializing.
2) If this isn't a golden rule of programming, it should be: always put off
until later what you don't _have_ to do now. For instance, does every last
one of those queries have to be run _before_ the user can use the form? Or
are some loading data that's less likely to be used, and are candidates for
being run on demand: i.e., only when the user does something that
specifically requires loading the data? Don't run the query until you must.
3) In a similar vein, perhaps there's only one or two queries that need be
run before the user can start using the form (e.g., a query to load a
selection list). Run that query, display the form, and then run the others
in the background. Easier said than done, but worth considering.
4) How likely is it that a query will _not_ exist? Unless it's very likely,
I'd be inclined to _assume_ it exists, and use an error trap to handle the
case where it doesn't. If the query can be expected to exist 95% of the
times the form is loaded (over the lifetime of the program), you'll save
yourself one time-consuming step 95% of the time by this method.
Quote:
>In the event of the form load, I put a lot of code as verifying the
>queries, if not there I create them, initialized the controls, etc. but
>with all of that code, it is very slow to load forms.
>Where could I put that code and have my forms load rapidly?
>I don't want to keep the form only hide. I want to unload and load form
>when necessary.
>--
>Nathalie Turgeon