LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Problems with a Form's behaviour

I would be grateful for help to resolve the following problem, please:

I present a form for my users. The form contains 4 listboxes, Cancel
and OK buttons. The listboxes are populated by code behind the form.

The user is asked to highlight any of the 4 options that will apply. In
the case of listbox 1 this is a straightforward either/or question.
If user highlights either listbox 2, 3 or 4, then they are taken to
another form with a single listbox where they again opt to highlight or
not....different forms for the listbox 2, 3 and 4 questions.

If user only chooses the original listbox 1 questions, then there
appear to be no problems. If they highlight listbox 2, 3 or 4 then after
they return to the original form, one of their original selections (in
either listbox 2, 3 or 4) will have been reset..........They can repeat
their steps and eventually they can exit the form with OK.

So the original form is called from the module, and code behind the
form populates the 4 listboxes. When either listbox 2, 3 or 4 is
highlighted, then a different form is presented with a single listbox,
and the user is then returned to the original form. When they have
made their selection, they hit OK to exit.

What I've found is this:

User highlights listbox1 then
highlights listbox2 and the listbox in the associated subform, then
highlights listbox3 and the listbox in the associated subform, then
highlights listbox4 and the listbox in the associated subform, then
they are returned to the original form.

Say at this point that all 4 listboxes are highligted (blue). They now
click OK to exit the form:

stepping through the code brings us to this point:
Private Sub OKButton_Click()
OKButton.Tag = "Selected"
CancelButton.Tag = ""
GetUserPrintOptions.Hide
End Sub

If I step through the above code, then I'm taken to:

Private Sub ListBox4_Change()
Me.Hide
GetUserPrintOptions.Hide
GetUserPrintBlankPagesOptions.Show
Unload GetUserPrintBlankPagesOptions
'GetUserPrintOptions.Show
Me.Show
End Sub

where End Sub is highlighted yellow. If I execute that line, then
I go to:

Private Sub ListBox3_Change()
Me.Hide
GetUserPrintOptions.Hide
GetUserPrintZeroPagesOptions.Show
Unload GetUserPrintZeroPagesOptions '''.Show
'GetUserPrintOptions.Show
Me.Show
End Sub .....again, this line highlighted

It now jumps to the start of the sub
Private Sub ListBox3_Change() and proceeds to run
that code again !!!

Can anyone help, please?

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


 
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
Strange if(***) behaviour? Excel 2003 - SPB Excel Discussion (Misc queries) 6 August 6th 06 05:34 PM
Having one form show another form's input? Lucosa New Users to Excel 3 June 13th 06 04:16 PM
A Form's Rowsourse Format John T Ingato Excel Programming 2 October 15th 03 06:42 PM
Pass Variables into Form's code Stuart[_5_] Excel Programming 3 August 23rd 03 04:55 AM
Key behaviour Rodney[_2_] Excel Programming 1 July 18th 03 11:07 AM


All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"