Combo Box Clear problem

Combo Box Clear problem

Anonymous
Not applicable
228 Views
3 Replies
Message 1 of 4

Combo Box Clear problem

Anonymous
Not applicable
Hi all,

I have a form with three combo boxes. On this form I have a "clear" button
that allows the user to "clear" the values of the combo boxes when it is
clicked. Here is what is going on: I have one combo box (cboA) that
populates two others (cboB and cboC). cboA contains items 1-9. When an
item is selected, cboB and cboC are enabled and populated based on what was
selected in cboA. Basically cboB is populated with very convoluted layer
names and cboC is populated with the definition of those layers (this way
the user can pick by layer name or layer description). So when a layer in
cboB is selected, the corresponding layer description is highlighted in
cboC. When the clear button is pressed, the current value of all three
combo boxes are supposed to "clear", but cboC will not clear properly. If
cboC is selected first rather than cboB, and the clear button is clicked,
all three clear with no problems. Below is the code for the clear button.
It almost seems like the enabled property of cboC is firing before the clear
property when cboB has been selected first. Does anyone have any insight as
to why this may be happening?

Private Sub cmdClear_Click()

cboFeatureType.Clear '(cboA)
cboSDSLayName.Clear '(cboB)
cboObjType.Clear '(cboC)

cboSDSLayName.Enabled = False
cboObjType.Enabled = False
Call UserForm_Initialize

End Sub

TIA,

Rob
0 Likes
229 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Have you tried stepping through it in the debugger to see if it's stepping
into one of your cbo events when it's cleared?
Glen


"Rob Outman" wrote in message
news:1724D5D465311A54297B213C2FFB7B3C@in.WebX.maYIadrTaRb...
> Hi all,
>
> I have a form with three combo boxes. On this form I have a "clear"
button
> that allows the user to "clear" the values of the combo boxes when it is
> clicked. Here is what is going on: I have one combo box (cboA) that
> populates two others (cboB and cboC). cboA contains items 1-9. When an
> item is selected, cboB and cboC are enabled and populated based on what
was
> selected in cboA. Basically cboB is populated with very convoluted layer
> names and cboC is populated with the definition of those layers (this way
> the user can pick by layer name or layer description). So when a layer in
> cboB is selected, the corresponding layer description is highlighted in
> cboC. When the clear button is pressed, the current value of all three
> combo boxes are supposed to "clear", but cboC will not clear properly. If
> cboC is selected first rather than cboB, and the clear button is clicked,
> all three clear with no problems. Below is the code for the clear button.
> It almost seems like the enabled property of cboC is firing before the
clear
> property when cboB has been selected first. Does anyone have any insight
as
> to why this may be happening?
>
> Private Sub cmdClear_Click()
>
> cboFeatureType.Clear '(cboA)
> cboSDSLayName.Clear '(cboB)
> cboObjType.Clear '(cboC)
>
> cboSDSLayName.Enabled = False
> cboObjType.Enabled = False
> Call UserForm_Initialize
>
> End Sub
>
> TIA,
>
> Rob
>
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Rob, I suspect you have an event cascade causing the problem. Start by
putting break points in the routines that populate your combo boxes, I'm
betting you'll see one of your routines fire after the clear method is
executed.


"Rob Outman" wrote in message
news:1724D5D465311A54297B213C2FFB7B3C@in.WebX.maYIadrTaRb...
> Hi all,
>
> I have a form with three combo boxes. On this form I have a "clear"
button
> that allows the user to "clear" the values of the combo boxes when it is
> clicked. Here is what is going on: I have one combo box (cboA) that
> populates two others (cboB and cboC). cboA contains items 1-9. When an
> item is selected, cboB and cboC are enabled and populated based on what
was
> selected in cboA. Basically cboB is populated with very convoluted layer
> names and cboC is populated with the definition of those layers (this way
> the user can pick by layer name or layer description). So when a layer in
> cboB is selected, the corresponding layer description is highlighted in
> cboC. When the clear button is pressed, the current value of all three
> combo boxes are supposed to "clear", but cboC will not clear properly. If
> cboC is selected first rather than cboB, and the clear button is clicked,
> all three clear with no problems. Below is the code for the clear button.
> It almost seems like the enabled property of cboC is firing before the
clear
> property when cboB has been selected first. Does anyone have any insight
as
> to why this may be happening?
>
> Private Sub cmdClear_Click()
>
> cboFeatureType.Clear '(cboA)
> cboSDSLayName.Clear '(cboB)
> cboObjType.Clear '(cboC)
>
> cboSDSLayName.Enabled = False
> cboObjType.Enabled = False
> Call UserForm_Initialize
>
> End Sub
>
> TIA,
>
> Rob
>
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
Hi guys,

I did what was suggested and it somehow magically worked itself out!

Thanx for the input!

Rob

"Jacob Dinardi" wrote in message
news:EC2C4687CBED8CAE1CE35C819EEBB04E@in.WebX.maYIadrTaRb...
> Rob, I suspect you have an event cascade causing the problem. Start by
> putting break points in the routines that populate your combo boxes, I'm
> betting you'll see one of your routines fire after the clear method is
> executed.
>
>
> "Rob Outman" wrote in message
> news:1724D5D465311A54297B213C2FFB7B3C@in.WebX.maYIadrTaRb...
> > Hi all,
> >
> > I have a form with three combo boxes. On this form I have a "clear"
> button
> > that allows the user to "clear" the values of the combo boxes when it is
> > clicked. Here is what is going on: I have one combo box (cboA) that
> > populates two others (cboB and cboC). cboA contains items 1-9. When an
> > item is selected, cboB and cboC are enabled and populated based on what
> was
> > selected in cboA. Basically cboB is populated with very convoluted
layer
> > names and cboC is populated with the definition of those layers (this
way
> > the user can pick by layer name or layer description). So when a layer
in
> > cboB is selected, the corresponding layer description is highlighted in
> > cboC. When the clear button is pressed, the current value of all three
> > combo boxes are supposed to "clear", but cboC will not clear properly.
If
> > cboC is selected first rather than cboB, and the clear button is
clicked,
> > all three clear with no problems. Below is the code for the clear
button.
> > It almost seems like the enabled property of cboC is firing before the
> clear
> > property when cboB has been selected first. Does anyone have any
insight
> as
> > to why this may be happening?
> >
> > Private Sub cmdClear_Click()
> >
> > cboFeatureType.Clear '(cboA)
> > cboSDSLayName.Clear '(cboB)
> > cboObjType.Clear '(cboC)
> >
> > cboSDSLayName.Enabled = False
> > cboObjType.Enabled = False
> > Call UserForm_Initialize
> >
> > End Sub
> >
> > TIA,
> >
> > Rob
> >
> >
>
>
0 Likes