A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Yes/No MsgBox - Return to Form



 
 
Thread Tools Display Modes
  #1  
Old July 3rd, 2004, 03:23 AM
Cassi
external usenet poster
 
Posts: n/a
Default Yes/No MsgBox - Return to Form

I have a simple msgbox with vbYesNo for an "upon close" event. When Yes is clicked it closes the form, which is fine. But, when No is clicked I want it to return to the form instead of closing it. How do I do this?
  #2  
Old July 3rd, 2004, 03:50 AM
fredg
external usenet poster
 
Posts: n/a
Default Yes/No MsgBox - Return to Form

On Fri, 2 Jul 2004 19:23:01 -0700, Cassi wrote:

I have a simple msgbox with vbYesNo for an "upon close" event. When Yes is clicked it closes the form, which is fine. But, when No is clicked I want it to return to the form instead of closing it. How do I do this?


The Close event is not the place to do this.
Use the Form's UnLoad event:

Cancel = MsgBox("Are you sure?",vbYesNo,"Closing Form") = vbNo
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #3  
Old July 3rd, 2004, 04:50 PM
Cassi
external usenet poster
 
Posts: n/a
Default Yes/No MsgBox - Return to Form

Thank you so much! It works great now.

"fredg" wrote:

On Fri, 2 Jul 2004 19:23:01 -0700, Cassi wrote:

I have a simple msgbox with vbYesNo for an "upon close" event. When Yes is clicked it closes the form, which is fine. But, when No is clicked I want it to return to the form instead of closing it. How do I do this?


The Close event is not the place to do this.
Use the Form's UnLoad event:

Cancel = MsgBox("Are you sure?",vbYesNo,"Closing Form") = vbNo
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show image in the form or report? JJ General Discussion 1 June 29th, 2004 06:01 AM
form doesn't update!!!!! manish Using Forms 4 June 15th, 2004 11:24 AM
Recordset in subform based on field in parent form Lyn General Discussion 15 June 14th, 2004 03:10 PM
surely a form with a ListBox can be used in a query? 1.156 Running & Setting Up Queries 14 June 2nd, 2004 04:54 PM
Yes/No boxes in forms Stephen Glynn New Users 14 May 30th, 2004 07:25 PM


All times are GMT +1. The time now is 12:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.