Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Unload vs Hide

I have 4 userforms

From the main menu - click on button1

Private Sub CommandButton1_Click()
Headcount.Show
MainMenu.Hide
End Sub

Works Fine!
====
from the Headcount form, if you click on the MainMenu button

Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Show
End Sub

I get Run-time Error: '400'
"Form already displayed, can't show modally"

In Properties, ShowModal = True

I'm stuck - I've also tried Load and Unload and cannot find a way around this.

Thanks for any help!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Unload vs Hide

hi.
the form is already showing as excel understands. the form is in memory just
hidden. so don't try to show it again. unhide it.
Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Unhide
End Sub

regards
FSt1

"CV323" wrote:

I have 4 userforms

From the main menu - click on button1

Private Sub CommandButton1_Click()
Headcount.Show
MainMenu.Hide
End Sub

Works Fine!
====
from the Headcount form, if you click on the MainMenu button

Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Show
End Sub

I get Run-time Error: '400'
"Form already displayed, can't show modally"

In Properties, ShowModal = True

I'm stuck - I've also tried Load and Unload and cannot find a way around this.

Thanks for any help!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Unload vs Hide

MainMenu.Visible = True might work better.

"FSt1" wrote:

hi.
the form is already showing as excel understands. the form is in memory just
hidden. so don't try to show it again. unhide it.
Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Unhide
End Sub

regards
FSt1

"CV323" wrote:

I have 4 userforms

From the main menu - click on button1

Private Sub CommandButton1_Click()
Headcount.Show
MainMenu.Hide
End Sub

Works Fine!
====
from the Headcount form, if you click on the MainMenu button

Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Show
End Sub

I get Run-time Error: '400'
"Form already displayed, can't show modally"

In Properties, ShowModal = True

I'm stuck - I've also tried Load and Unload and cannot find a way around this.

Thanks for any help!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Unload vs Hide

The UserForm can use Hide and Show. The Controls on the UserForm and Tool
Bars use the <TypeControl.Visible = <Boolean 'True or False

"CV323" wrote:

I have 4 userforms

From the main menu - click on button1

Private Sub CommandButton1_Click()
Headcount.Show
MainMenu.Hide
End Sub

Works Fine!
====
from the Headcount form, if you click on the MainMenu button

Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Show
End Sub

I get Run-time Error: '400'
"Form already displayed, can't show modally"

In Properties, ShowModal = True

I'm stuck - I've also tried Load and Unload and cannot find a way around this.

Thanks for any help!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Unload vs Hide

Thank you - both of you.

"JLGWhiz" wrote:

The UserForm can use Hide and Show. The Controls on the UserForm and Tool
Bars use the <TypeControl.Visible = <Boolean 'True or False

"CV323" wrote:

I have 4 userforms

From the main menu - click on button1

Private Sub CommandButton1_Click()
Headcount.Show
MainMenu.Hide
End Sub

Works Fine!
====
from the Headcount form, if you click on the MainMenu button

Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Show
End Sub

I get Run-time Error: '400'
"Form already displayed, can't show modally"

In Properties, ShowModal = True

I'm stuck - I've also tried Load and Unload and cannot find a way around this.

Thanks for any help!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Unload vs Hide

When I used this:

Headcount.Hide
MainMenu.Visible

The following error: "Function or interface marked as restricted..."

Then:
Headcount.Hide
MainMenu.Unhide

Error: "Method or data member not found"



"JLGWhiz" wrote:

The UserForm can use Hide and Show. The Controls on the UserForm and Tool
Bars use the <TypeControl.Visible = <Boolean 'True or False

"CV323" wrote:

I have 4 userforms

From the main menu - click on button1

Private Sub CommandButton1_Click()
Headcount.Show
MainMenu.Hide
End Sub

Works Fine!
====
from the Headcount form, if you click on the MainMenu button

Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Show
End Sub

I get Run-time Error: '400'
"Form already displayed, can't show modally"

In Properties, ShowModal = True

I'm stuck - I've also tried Load and Unload and cannot find a way around this.

Thanks for any help!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Unload vs Hide

MainMenu.Visible = True 'Show the menu bar
MainMenu.Visible = False 'Hides the menu bar

Headcount.Hide 'Hides the UserForm
Headcount.Show 'Shos the UserForm
Unload Headcount 'Closes the UserForm



"CV323" wrote:

When I used this:

Headcount.Hide
MainMenu.Visible

The following error: "Function or interface marked as restricted..."

Then:
Headcount.Hide
MainMenu.Unhide

Error: "Method or data member not found"



"JLGWhiz" wrote:

The UserForm can use Hide and Show. The Controls on the UserForm and Tool
Bars use the <TypeControl.Visible = <Boolean 'True or False

"CV323" wrote:

I have 4 userforms

From the main menu - click on button1

Private Sub CommandButton1_Click()
Headcount.Show
MainMenu.Hide
End Sub

Works Fine!
====
from the Headcount form, if you click on the MainMenu button

Private Sub CommandButton25_Click()
Headcount.Hide
MainMenu.Show
End Sub

I get Run-time Error: '400'
"Form already displayed, can't show modally"

In Properties, ShowModal = True

I'm stuck - I've also tried Load and Unload and cannot find a way around this.

Thanks for any help!

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
Unload/Hide Userform when switching to a new Wbk avi Excel Programming 1 March 14th 07 08:25 PM
Unload a COMaddin [email protected] Excel Programming 4 August 13th 06 08:34 AM
Userform Question (Load/Unload/Show/Hide) RPIJG[_76_] Excel Programming 8 November 2nd 05 08:29 PM
Excel Won't Unload... Steven8R Excel Programming 3 October 20th 04 04:42 AM
Unload Me Chip Pearson Excel Programming 0 September 5th 03 12:56 AM


All times are GMT +1. The time now is 09:14 AM.

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"