Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I am having unpredictable results with Hide, Show and Unload in 4 non-dependent userforms: frmInput, frmAllocate, frmReport, frmPrint. On each form are Hide and Quit (=unload) cmdbuttons. On a wsheet is a single 'Reveal' cmdbutton and cmdbuttons to invoke each form. In each Hide button the code is simply: Private Sub cmdHide_Click() frmReports.Hide 'frmReports for example End Sub The wsheet 'Reveal' button is: Sub RevealForm() If UserForms.Count 0 Then UserForms(0).Show 'Reveal hidden form Else MsgBox "No forms hidden." End If End Sub When unloading say frmReport, frmInput is often loaded but not shown. This means none of the forms can be shown as in each of the wsheet cmdbutton which calls the forms is (frmInput by example): If UserForms.Count 0 Then If UserForms(0).Name = "frmInput" Then formname = "Input" If UserForms(0).Name = "frmAllocate" Then formname = "Allocate" If UserForms(0).Name = "frmReport" Then formname = "Report" If UserForms(0).Name = "frmPrint" Then formname = "Print" MsgBox "'Input Data' error" & vbCr & vbCr & _ "The " & formname & " form is still open. " Exit Sub 'This passes code to Show form being executed End If There is no point in leaving forms loaded as it can be a while before another utility is needed. Can anyone suggest where I might be going wrong or if there is a better strategy please? T.I.A Geoff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Making the forms scroll bar show - figures. | Excel Worksheet Functions | |||
How can I hide check box created via FORMS together with column? | Excel Discussion (Misc queries) | |||
How do I hide the outline of a Forms Group Box? | Excel Discussion (Misc queries) | |||
Can you hide forms checkboxes | Excel Programming | |||
how do you hide a forms command button | Excel Programming |