Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unload user form problem

Status
Not open for further replies.

angiem

MIS
Sep 29, 2000
116
CA
problem is I can't get it to unload.

What I was hoping to achieve was that the user selects from a listbox on the userform(sheetfrm) clicks on a command button(cmdOK) and then it fires up another userform(matchfrm) closing the first one down


Private Sub CmdOK_Click()
gblnfinish = true
unload me
matchfrm.show
End Sub

What am I doing wrong?

Angie
 
Hi angiem,

It's OK in principle. What exactly does happen?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Won't work as you are trying because sheetfrm needs to be alive so the CmdOK click procedure can end.

Unload sheetfrm from matchfrm's initialize event.
 
In answer to Tony, I see both forms with the second one over the first.

I've also tried putting the unload command in the initialize event on the 2nd form and that didn't work either.

Angie
 
Hi Angie,

Do you have any code in Terminate or Deactivate Events? Or, do you have any pointers to sheetfrm - or do you reference it from matchfrm at all? I'm guessing a bit because there no reason from what you've posted that it shouldn't work. You could cheat and add [blue]Me.Hide[/blue] before unloading!! But that doesn't really solve the problem.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Hi Tony

No I've no code in those events, I don't reference it from matchfrm at all, and I've even tried me.hide before unloading and it still didn't work. I just can't figure it out.

Angie

Angie
 
Hi Angie,

You haven't got ScreenUpdating set to False, have you?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Angie, nudge nudge, bottom left of Tony's Post, nudge nudge, 'Thank.......', nudge nudge :)

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top