Actually, I've got a lot of different messages to be displayed by this
system. The messages, their ID number, and the boolean indicating whether
the user still wants to see this message are all stored in a 3-field
table,
but all that really confuses the issue at hand.
Here's some simplified code. When I execute this, the dialog box opens
correctly, but the code continues to execute, but interestingly it opens
the
next form behind the dialog box. In my actual application I open an Excel
spreadsheet following a dialog box, and Excel opens over the top of the
dialog, rather than underneath it.
Thanks again for your help.
Private Sub Command0_Click()
' Call the optional notification, hoping that code will stop and wait for
user
Call ShowNotice
' Continue on with whatever process (open another form)
DoCmd.OpenForm "AnyOtherForm"
DoCmd.Maximize
End Sub
Private Sub ShowNotice()
' Open notification form in hidden mode, to check and see if user still
wants to see this notice
DoCmd.OpenForm "z Notification", acNormal, "", "", , acHidden
If Forms![z Notification]![ShowIt] = -1 Then ' Has user elected not to
see this notice again?
DoCmd.OpenForm "z Notification", , , , , acDialog ' Show the notice,
open visible as dialog
Else
DoCmd.Close acForm, "z Notification" ' User doesn't want to see this
again, close the hidden form
End If
End Sub
David C. Holley said:
So then what is the specific text of the message that your presenting?
How/where are you storing the value so that the msgBox is not displayed
more than once?
In regards to the other post (the code continues to run) please post the
code?
waynemb wrote:
Seems to me that the msgbox stops whatever code it's inserted into, but
maybe
I'm not understanding. What I'm trying to accomplish is a message box
that
has a checkbox that the user can click to set a variable so that
message box
is not shown again. I want it to stop the code where it's inserted, so
the
user can be notified of whatever, and then continue - but then once the
user
has memorized the message he can click the checkbox so he won't have to
see
the message over and over again.
It looks like Mr. Renolds has a simple solution.
Thanks for your help.
:
Yes, just insert the msgbox function in an if...then statement where
you
want the code to stop. *However*, what are you trying to accomplish -
why do you want the code to halt for user input?
waynemb wrote:
Is there some way to create a form that will suspend execution of the
code
that calls it, until the user presses an OK button - so it works the
way
msgbox works?
I'd use msgbox, but I need to include a checkbox on the form so the
user can
choose to not see this message again.