From: Linq Adams via AccessMonster.com on
Sorry, Doug, I missed that! But, of course, the code did nothing depending on
which button was pressed!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201002/1

From: Jesse via AccessMonster.com on
Thank you for your help Douglas. I have incerted the code you provided and I
am recieving the same results as my code. Upon clicking the ok button the
report runs. But if the cancel button is click the report still runs. I would
like the cancel button to cancel the action and return to the form. Here is
what I have on my report open. Again thank you for the help.

Private Sub Report_Open(Cancel As Integer)

Dim Response As Long

Response = MsgBox("Approximate wait time is 5 minutes." _
& Chr(13) & Chr(10) & _
"Push OK to continue,Cancel to Quit", vbOKCancel)
If Response = vbOK Then
DoCmd.OpenReport "Picks Hourly - 24hr"
End If
DoCmd.Maximize
End Sub

Douglas J. Steele wrote:
>Actually, the posted code DOES include what buttons should appear. The ", 1"
>after the text corresponds to vbOkCancel.
>
>> Perhaps you need to go back and look at Access Help for MsgBox!
>>
>[quoted text clipped - 3 lines]
>> All
>> you're doing is presenting a message!

--
Message posted via http://www.accessmonster.com

From: Jesse via AccessMonster.com on
I have fixed my problem with a different path. I placed the code on the
command click instead of having it on the report open. It works the way its
suppose to now. Thank you again for your help.

Jesse wrote:
>Thank you for your help Douglas. I have incerted the code you provided and I
>am recieving the same results as my code. Upon clicking the ok button the
>report runs. But if the cancel button is click the report still runs. I would
>like the cancel button to cancel the action and return to the form. Here is
>what I have on my report open. Again thank you for the help.
>
>Private Sub Report_Open(Cancel As Integer)
>
>Dim Response As Long
>
> Response = MsgBox("Approximate wait time is 5 minutes." _
> & Chr(13) & Chr(10) & _
> "Push OK to continue,Cancel to Quit", vbOKCancel)
> If Response = vbOK Then
> DoCmd.OpenReport "Picks Hourly - 24hr"
> End If
>DoCmd.Maximize
>End Sub
>
>>Actually, the posted code DOES include what buttons should appear. The ", 1"
>>after the text corresponds to vbOkCancel.
>[quoted text clipped - 4 lines]
>>> All
>>> you're doing is presenting a message!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201002/1

From: BruceM via AccessMonster.com on
You would have needed Cancel = True in the code to cancel the report opening.


Jesse wrote:
>I have fixed my problem with a different path. I placed the code on the
>command click instead of having it on the report open. It works the way its
>suppose to now. Thank you again for your help.
>
>>Thank you for your help Douglas. I have incerted the code you provided and I
>>am recieving the same results as my code. Upon clicking the ok button the
>[quoted text clipped - 20 lines]
>>>> All
>>>> you're doing is presenting a message!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201002/1

From: BruceM via AccessMonster.com on
I meant to mention that Douglas posted code for the Click event of a command
button, not the report's Open event. You were trying to open a report in its
own Open event.

Jesse wrote:
>I have fixed my problem with a different path. I placed the code on the
>command click instead of having it on the report open. It works the way its
>suppose to now. Thank you again for your help.
>
>>Thank you for your help Douglas. I have incerted the code you provided and I
>>am recieving the same results as my code. Upon clicking the ok button the
>[quoted text clipped - 20 lines]
>>>> All
>>>> you're doing is presenting a message!

--
Message posted via http://www.accessmonster.com