|
This week I am going to show you how to create a form that will display a ‘Please Wait – Query Being Processed’ message, whilst the query is being processed. If you have a very large database, a complex query and a slow computer, sometimes the processing of a query can seem to take a very long time for the user. So, a little form, telling the user that the Query is in process, may allay some fears that ‘Nothing’ is happening.
The first thing you need to do is set up your form. To do this, create an unbound form, i.e. choose to ‘Create a form in Design View’ from the options listed.
Set the following properties for the form (to open the properties window of the form right click in the upper left-hand corner of the form, in the grey square where the two rulers meet, then select ‘properties’ from the drop down list).
With the Properties window open, click on the Format Tab and set the following: Caption: Query In Progress
ScrollBars: Neither
RecordSelectors: No
NavigationButtons: No
Then, switch to the ‘Other’ tab and set the following properties:
Popup: Yes
Modal: Yes
Add a label to this form by clicking on the ‘Label’ (Aa) button on your toolbox, then by clicking and dragging on your form. To this label add the following text:
“Please Wait – Query In Progress”
Save this form as ‘QueryInProgress’
Next you will need to create a Macro to both run the query and display the form. To do this:
Click on ‘Macros’ and add the following Actions to the new Macro:
OpenForm
Form Name – QueryInProgress
View – Form
Data Mode – Read Only
Window Mode – Normal
RepaintObject
Object Type – Form
Object Name – QueryInProgress
Open Query
Query Name – Name of your query
View - Datasheet
Close
Object Type – Form
Object Name – QueryInProgress
Save - No
Close and save this Macro, call it QueryInProgressMacro
Now, run this Macro anytime you wish to run your query and display the ‘Please Wait’ form.
Do you like this tip? Subscribe to my weekly Newsletter to receive tips
weekly via email.
Click Here to subscribe.
|