Queryclose

B

Bishop

I have the following code:

Private Sub UserForm_QueryClose(Cancel As Integer, _
CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
Unload AddTitle
AddOrFind.Show
End If
End Sub

What I'm trying to accomplish is when I click the red X (close) in the upper
right corner of AddTitle I want the AddTitle userform to close and the
AddOrFind userform to open. Instead what's happening is the AddOrFind
userform is showing on top of the AddTitle userform. How do I get the
AddTitle userform disappear?
 
P

Patrick Molloy

see below

Bishop said:
I have the following code:

Private Sub UserForm_QueryClose(Cancel As Integer, _
CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
Me.Hide
'' Unload AddTitle 'rem out
 
B

Bishop

Ok, that gets rid of the AddTitle userform but if I pull it up again the
QueryClose function doesn't even respond. Clicking the red X does nothing.

Here's how this flows so you have a better idea. When the spreadsheet opens
the AddOrFind userform shows. AddOrFind has 3 buttons one of which calls the
AddTitle userform. If I call up the AddTitle userform and click the red X
AddTitle goes away (Me.Hide) and AddOrFind pops back up. If I choose
AddTitle again the userform shows but the QueryClose function no longer
responds.
 
B

Bishop

Thanks for the _Click info. I kept wondering why I couldn't use my mouse to
select those. However, I'm a little fuzzy on "just paste it in." What am I
pasting where?
 
P

Patrick Molloy

I never had this routine in my demo

Private Sub UserForm_QueryClose
....
End Sub
 
B

Bishop

I'm not seeing this demo you're talking about. Is it an attachment? Where
do I locate it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top