Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Query Close code question??

How would I or how could I make the following code close the userform and
open another? I would like the user to be able to use the 'X' window button
to close the user form and open another not close the Macro.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = False
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Query Close code question??

On Oct 30, 11:38 am, Mekinnik
wrote:
How would I or how could I make the following code close the userform and
open another? I would like the user to be able to use the 'X' window button
to close the user form and open another not close the Macro.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = False
End If
End Sub


Could you not just add an Else condition in there? Like:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
If CloseMode = vbFormControlMenu Then
Cancel = False
Else
frmWhatever.show
End If
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Access Query save and close through Excel VBA BigPig Excel Programming 0 May 8th 07 04:01 PM
difference Close and Nothing in query x taol Excel Programming 1 March 30th 06 11:52 AM
save & close after web query refresh JVLin Excel Discussion (Misc queries) 0 September 28th 05 04:27 PM
Auto Open file VBA Refresh MS Query Save Close gcutter[_2_] Excel Programming 2 September 26th 05 03:07 PM
Close VB in Code Paul Watkins[_2_] Excel Programming 2 December 17th 03 09:25 PM


All times are GMT +1. The time now is 06:11 PM.

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

About Us

"It's about Microsoft Excel"