Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Form display errors

First time through the form (GetUserPrintOptions), displays
correctly.
The form displays 4 listboxes and invites the user to highlight
any of the boxes that will apply.
If the user opts to highlight Q3 or Q4, then a further different
form displays a different question for the user to highlight or not.
The user is returned to GetUserPrintOptions, and when they are
ready will click OK.

Problem 1: If user selects a Q3 or Q4 question, then they move
to the other form and make their choice. When they return to
GetUserPrintOptions, they find that one of their previous choices
has been reset!

They can repeat their actions, and the routine will run successfully
but then:

Problem 2: If problem 1 has occurred (and Excel has not then been
closed), when they present the GetUserPrintOptions form a second
time.... they find that the first of the 4 listboxes is blank!

Frustrating for the user, and very annoying for me. I cannot find out
my errors, so help would be most welcome, please.

Here's the form initialisation code:

Option Explicit

Private Sub CancelButton_Click()
CancelButton.Tag = "Selected"
OKButton.Tag = ""
GetUserPrintOptions.Hide
End Sub

Private Sub OKButton_Click()
OKButton.Tag = "Selected"
CancelButton.Tag = ""
GetUserPrintOptions.Hide
End Sub

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

Private Sub ListBox2_Change()

Me.Hide
'GetUserPrintOptions.Hide
GetUserHideColumnOptions.Show
GetUserHideColumnOptions.Hide
'GetUserPrintOptions.Show
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

And here's the Module code:

With GetUserPrintOptions
.Show
If .OKButton.Tag = "Selected" Then
If .ListBox1.Selected(0) Then
Global_PrintAllBooks_Sheets = True
End If
If .ListBox2.Selected(0) Then
HideCols = True
With GetUserHideColumnOptions
If .ListBox1.Selected(0) = True Then
Global_HideSameCols = True
End If
End With
End If
If .ListBox3.Selected(0) Then
PrintZeroPages = True
With GetUserPrintZeroPagesOptions
If .ListBox1.Selected(0) = True Then
Global_PrintZeroPages = True
End If
End With
End If
If .ListBox4.Selected(0) Then
PrintBlankPages = True
With GetUserPrintBlankPagesOptions
If .ListBox1.Selected(0) = True Then
Global_PrintBlankPages = True
End If
End With
End If
Else
'Cancel Button was pressed so set defaults
Global_PrintAllBooks_Sheets = False
Global_HideCols = False
Global_PrintZeroPages = False
Global_PrintBlankPages = False
End If
End With
Unload GetUserPrintOptions
Unload GetUserPrintBlankPagesOptions
Unload GetUserHideColumnOptions
Unload GetUserPrintZeroPagesOptions

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/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
display number in form of words proximalstranger Excel Worksheet Functions 1 October 23rd 07 09:20 PM
Display Row of Data as Form/Page Tim Nicholson Excel Discussion (Misc queries) 3 April 4th 06 06:19 PM
Excel Form File Errors hartleydc Excel Discussion (Misc queries) 0 September 29th 05 11:20 PM
Display form from an VB application in Excel kuhni Excel Discussion (Misc queries) 0 August 10th 05 06:04 PM
Display many instances of the same form Warrio Excel Programming 3 October 7th 03 10:56 AM


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