Re: make execution wait for button push - like msgbox?
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Thu, 17 Nov 2005 17:07:50 -0500
I think the Problem with the code is in these lines
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
Since the form is already open, the second open statement doesn't open it in
Dialog mode. If you can't get the value of ShowIt some other way (and you
must be storing it someplace) then you probably will have to close the form
and then open it again in dialog mode.
DoCmd.Close acForm, "z Notification"
DoCmd.OpenForm "z Notification",WindowMode:=acDialog
"waynemb" <waynemb@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5DA64307-CDEA-4B55-88F6-7F668CC3E845@xxxxxxxxxxxxxxxx
> 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
> spread*** 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" wrote:
>
>> 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.
>> >
>> > "David C. Holley" wrote:
>> >
>> >
>> >>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.
>> >>
>>
.
- Follow-Ups:
- Re: make execution wait for button push - like msgbox?
- From: waynemb
- Re: make execution wait for button push - like msgbox?
- From: waynemb
- Re: make execution wait for button push - like msgbox?
- References:
- Re: make execution wait for button push - like msgbox?
- From: David C. Holley
- Re: make execution wait for button push - like msgbox?
- From: David C. Holley
- Re: make execution wait for button push - like msgbox?
- From: waynemb
- Re: make execution wait for button push - like msgbox?
- Prev by Date: Re: Automatic import not working
- Next by Date: Re: make execution wait for button push - like msgbox?
- Previous by thread: Re: make execution wait for button push - like msgbox?
- Next by thread: Re: make execution wait for button push - like msgbox?
- Index(es):