Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update Access Query save and close through Excel VBA | Excel Programming | |||
difference Close and Nothing in query | Excel Programming | |||
save & close after web query refresh | Excel Discussion (Misc queries) | |||
Auto Open file VBA Refresh MS Query Save Close | Excel Programming | |||
Close VB in Code | Excel Programming |