Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Hiding a form

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Hiding a form

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.

"Dan Perkins" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Hiding a form

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

"JLGWhiz" wrote:

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.

"Dan Perkins" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Hiding a form

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.

--
Regards,
Tom Ogilvy


"Dan Perkins" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Hiding a form

It might be right now, but your approach is flawed.

--
Regards,
Tom Ogilvy


"Dan Perkins" wrote:

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

"JLGWhiz" wrote:

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.

"Dan Perkins" wrote:

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

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
User form and hiding spreadsheet Chip Smith Excel Discussion (Misc queries) 0 March 29th 06 07:46 PM
Hiding information on sheet behind a form Duncan[_5_] Excel Programming 11 December 14th 05 12:28 PM
User form and hiding worksheets Jim May Excel Programming 2 September 26th 05 02:00 AM
Form not hiding LB79 Excel Discussion (Misc queries) 6 August 24th 05 02:34 PM
Bound column does not work after hiding form TerryK[_2_] Excel Programming 5 December 10th 03 03:21 AM


All times are GMT +1. The time now is 05:22 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"