Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Userform will not exit correctly

I have a form which contains 4 listboxes, each
offering a single option. If listboxes 2 to 4 are
selected, then a different listbox is then presented,
again with a single option.

User should be able to cycle through the original
form interacting with the forms behind the listboxes
before finally choosing Ok or Cancel.

What is happening is that when the user makes a
choice in one of the forms behind a listbox, then
when returned to the original form, that listbox may
have been cleared....so they have to go through
the process again.

Here is the _Change code:

Private Sub ListBox2_Change()
Me.Hide
GetUserHideColumnOptions.Show
GetUserHideColumnOptions.Hide
Me.Show
End Sub

Private Sub ListBox3_Change()
GetUserPrintOptions.Hide
GetUserPrintZeroPagesOptions.Show
GetUserPrintOptions.Show
End Sub

Private Sub ListBox4_Change()
GetUserPrintOptions.Hide
GetUserPrintBlankPagesOptions.Show
GetUserPrintOptions.Show
End Sub

What am I doing wrong, please?

Regards.




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Userform will not exit correctly

You don't have any code in the original userform's activate event to reset
the list boxes, do you? The .Show after closing the second form would run
it.

--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Userform will not exit correctly

Excuse further ignorance, please, but is the Activate event
the same as the Initialise Event? I have the following in the
original form for _Initialise (but nothing for an _Activate
Event):

Private Sub UserForm_Initialize()

'Fill the ListBoxes
With GetUserPrintOptions.ListBox1
.RowSource = ""
.AddItem "You want to print EVERY Worksheet in EVERY chosen Workbook"
End With

With GetUserPrintOptions.ListBox2
.RowSource = ""
.AddItem "You will want to hide Column(s)"
End With

With GetUserPrintOptions.ListBox3
.RowSource = ""
.AddItem "You want to include the printing of pages that total '0.00'"
End With

With GetUserPrintOptions.ListBox4
.RowSource = ""
.AddItem "You want to include the printing of pages with no totals"
End With

End Sub

Many thanks,

Regards,

"Jim Rech" wrote in message
...
You don't have any code in the original userform's activate event to reset
the list boxes, do you? The .Show after closing the second form would run
it.

--
Jim Rech
Excel MVP




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003


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
How to get userform Cancel button to invoke Exit Sub in calling macro? Craig Remillard New Users to Excel 1 November 19th 09 03:55 AM
Exit Sub Jeff Excel Discussion (Misc queries) 2 March 1st 08 06:21 PM
how do i make a button from a userform exit onto the document in . Pieface New Users to Excel 1 April 17th 07 07:35 PM
Disable Exit button on a UserForm Noemi Excel Discussion (Misc queries) 1 September 14th 06 09:37 PM
Run when exit PH NEWS Excel Worksheet Functions 1 July 18th 06 03:53 PM


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