Calling Message Displays while program is Running.

G

Guest

My predecessor set up code as follows:

1. Menu Item has click event which calls User Question form.
2. Question Form has click event which calls message form.
3. Message form Displays message ie "Please wait while Processing is Being
Done"
and in the Timer event of that form contains the function call to do
processing. The timer interval is set to 1000.

Isn't this an incorrect method, since the code should only execute once, and
the timer would have it continually execute ?

Also, if you wanted to keep the same method of coding, calling up forms to
gather user information and display work in process messages, could it be
done by leaving item #1 as is and in #2 code something like this in the click
event:

DoCmd.Openform("Processing Message")
Execute function to process data
DoCmd.Close

I tried the above code but it didn't seem to function correctly. The
processing message should cancel out the form in item # 1, then when the
function to process data is complete, all forms should close and return to
the main menu.

Thanks.
 
A

Albert D.Kallal

I tend to agree, I don't see the need for the timer event.

DoCmd.Openform("Processing Message")
Execute function to process data
DoCmd.Close

To the above, the code will not give ms-access a chance to "gulp" some air
to update the display.

So, change the above to:

DoCmd.Openform ("Processing Message")
DoEvents
Execute function to process data
DoCmd.Close

The "doEvents" allows ms-access to process all things like screen updates,
mouse movements etc.

Also, just as caution

DoCmd.Openform ("Processing Message")
DoEvents
Execute function to process data
DoCmd.Close acForm,"Processing Message"

When you use the docmd.close, you want to specify the form, since you might
change focus...and close will operate on the current form that has the
focus, not one you might "think". So, always specify the form you want to
close.......
 

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