Informing user of a process running using MsgBox

G

Guest

I am trying to set up a database to allow users to update information in a
table using an update query, i have this all working off a button on my
switchboard, and have disabled notifications so the user doesnt have to
confirm that they want to update the table.

what I am having trouble doing, it to display a message box notifying the
user that the query is running, while allowing the query to run in the
backfround without need for user confirmation,

any help on this would be extremely useful,

Regards
 
A

Albert D. Kallal

One way is to play a big large text label on the screen...perhaps in bold
red letters.



Running update....please wait.....


Make the above label on your screen with visible = false.

The, in code go:

me.myLableName.visible = true
doevents

currentdb.execute "your sql update here"

msgbox "update done..thank you"
me.myLableName.visible = false

using currentdb.Execute is preferable to docmd.runsql as does not make
prompts for the user....
 
G

Guest

That seems as though it would be perfect for what i need,

i have now set it up so that all buttons disappear leaving a more or less
blank screen with the text, however, it seems as though Access is ignoring
the order of commands in the procedure and is running the query firs,
regardless of the fact that it is the last thing in the procedure,

Any ideas?

Regards
 
A

Albert D. Kallal

Corvus said:
That seems as though it would be perfect for what i need,

i have now set it up so that all buttons disappear leaving a more or less
blank screen with the text, however, it seems as though Access is ignoring
the order of commands in the procedure and is running the query firs,
regardless of the fact that it is the last thing in the procedure,

Any ideas?


Note my use of doevents. DoEvents will flush out and execute the pending
list of commands.

if you have code running, and change display, or visible of controls, and
don't execute a doevents, you not normally see the results until the code
completes.

further, you don't really have to use the visible trick, you could simply
launch a form that looks like a dialog box

that simply displays please wait....

You cod would be

docmd.Openform "WaitForm"
doevents

.....you update code here


docmd.close acForm,"Waitform"

So, you can well popup a form that displays message.

However, if you using visible, or launch a form...you still have to put in a
doevents to give ms-access a "gulp" of air to process those pending
events...
 

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