Hiding a form

G

Guest

I have created a series of forms.
Example: UserForm1 and UserForm2
In UserForm1 I have a Command Button that has the code
UserForm1.Hide
UserForm2.Show

In UserForm2, I have a Command Button to exit. The idea is to hide Userform2
and show Userform1. The code is
UserForm2.Hide
UserForm1.Show

When 1 click the command button on UserForm1, it is no longer visible and
UserForm2 is visible. The problem is when I click the exit command button in
UserForm2. The result of this is that UserForm1 is show, but UserForm2 is not
hidden. I cannot access it or click on any controls, but it is still visible.

I have also tried to unload UserForm2, and that does not succeed.

I am using Excel 2003 (11.8003.8036) SP2 (Microsoft Office Professional)

Any help would be appreciated.

Thanks

Dan Perkins
 
G

Guest

Maybe UserForm2 becomes UserForm1. Try giving them names and use the name in
your code. I haven't tried it yet, but I think that might be the problem.
 
G

Guest

After further playing around, I have discovered that this problem only occurs
if the spreadsheet is visible. By minimizing the spreadsheet, everything
works correctly.

I believe that it is actually a screen painting issue within Excel
 
G

Guest

In userform1 have the code

UserForm1.Hide
UserForm2.Show
Userform1.Show

in Userform2

Unload Me

Otherwise you lock up userform2 in a deathloop such as you have deserved.
 

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