MsgBox Function Explained?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am sequencing a number of action queries but want to build in some safety
checks. At a certain point I want a query to open up so that I can check for
certain values before proceeding. I followed this action with a yes/no
MsgBox. When this opens I cannot activate the windows displaying the
datasheet from the query to that I can look at the results.

I would like the ability look at the query results, say yes to continue
through the sequence, or to say no, and then resume from that point in the
sequence at a later time.

How can I do this? Thank you.
 
Hi,
you will not be able to do that with a default msgbox...the default msgbox
will always receive the focus until you click a button on it. So you will
need to find some other way...one coming to mind would be to use a custom
form formatted to look like a msgbox. Then within your code you could open up
this form at any point, look at your queries and then press a buttom on this
form which finishes of the rest you wanted to do and of course closes itself.
HTH
Good luck
 
So, will this form or a message box stop the sequence of the executing
queries? What code will pause the sequence of the queries? Thanks for your
help
 
A custom form will not stop the code it will just open and then access
continues with the rest.
You need to either set some form of breakpoint which will be entered when
the form enteres and then resumed when it is being closed or just split the
code in half. Run the one half till you open the form and then the other half
after you close the form. There are options to actually pause code with an
API call, but I'm not sure if you want that since you would need to specify a
specific amount of time to pause and as soon as that is over the code will
resume no matter if you are done looking at the results or not.
HTH
Good luck
 
Open the form in Dialog mode. This stops subsequent code from executing until
the form is closed and its visible property is set to False.
 
That defeats the whole purpose of using the form in the first place.
Then the OP could have just sticked to a msgbox which also requires user
interaction before anything else will be done!
 
freakazeud said:
That defeats the whole purpose of using the form in the first place.
Then the OP could have just sticked to a msgbox which also requires
user interaction before anything else will be done!

Not if he uses the form to display the results of the query.
 
OK Guys, let me see if I understand correctly. I design a dialog form that
will display the query results I want to look at. Being in Dialog mode, this
in itself will stop the sequence. I can tie events to the onclick properties
of command buttons, what action tells the sequence to continue? I can label
one "do you want to continue? But what will it's event be? I really
appreciate the help. Thanks
 
Jeff said:
OK Guys, let me see if I understand correctly. I design a dialog
form that will display the query results I want to look at. Being in
Dialog mode, this in itself will stop the sequence. I can tie events
to the onclick properties of command buttons, what action tells the
sequence to continue? I can label one "do you want to continue? But
what will it's event be? I really appreciate the help. Thanks

First off it will have to be a form with a ListBox to display the query results
or a continuous form that displays the query data directly. A Datasheet form
cannot be opened with the acDialog argument (it will be ignored).

Second, your code wil continue as soon as the dialog form is made hidden or
closed. Normally, you would have one option hide the form and another option
close it. The line of code immediately after opening the form can be used to
test if the form is still open (which will mean you chose one particular
option). If it is NOT open then your code "knows" that the other option was
chosen. If one of the options needs to examine anything on the dialog form then
obviously that option is the one that should hide it rather than close it.
 
freak, John and Rick: Thanks, I built two forms each with option to continue
and stop. Code behind continue button just closes the form and the code does
continue. Code behind the stop closes process and form, then opens another
form with button to continue, which activates all the code from when the
process previously stops. It is probably not designed the best way but I am
learning. Appreciate all your help. I could not find the information you
shared about the "Dialog" or MsgBox in the help files.
 
Back
Top