Am I that stupid? 
Author Message
 Am I that stupid?

Is it just me or is there no way to tell when a user changes the selection
in a ComboBox control set to style "2 - Dropdown List".  It seems most of
the events are disabled in this mode.

To accomplish this I store the value in the control using the gotfocus event
and then on the click event, check to see if the value in the control is now
different.  Shouldn't it be easier than that?

Let me know if I'm just a little thick in the skull or the ComboBox control
is a little lacking in functionality.

-jeffie




Mon, 16 Sep 2002 03:00:00 GMT  
 Am I that stupid?
What functionality do you feel is lacking? I' haven't had any
troubles with it (other than you use the Click event rather than
the Change event).

--

~~~~~~~~~~~~~~~~~~~~
"For every action, there is an equal and opposite criticism."


Quote:
> Is it just me or is there no way to tell when a user changes the
selection
> in a ComboBox control set to style "2 - Dropdown List".  It
seems most of
> the events are disabled in this mode.

> To accomplish this I store the value in the control using the
gotfocus event
> and then on the click event, check to see if the value in the
control is now
> different.  Shouldn't it be easier than that?

> Let me know if I'm just a little thick in the skull or the
ComboBox control
> is a little lacking in functionality.

> -jeffie





Mon, 16 Sep 2002 03:00:00 GMT  
 Am I that stupid?
If you're trying to use the Change event, you'll need to move that code to the click event.

Private Sub Combo1_Click()
   Debug.Print Combo1.List(Combo1.ListIndex) 'Shows the item that the user selected
End Sub

Quote:

> Is it just me or is there no way to tell when a user changes the selection
> in a ComboBox control set to style "2 - Dropdown List".  It seems most of
> the events are disabled in this mode.

> To accomplish this I store the value in the control using the gotfocus event
> and then on the click event, check to see if the value in the control is now
> different.  Shouldn't it be easier than that?

> Let me know if I'm just a little thick in the skull or the ComboBox control
> is a little lacking in functionality.

> -jeffie





Mon, 16 Sep 2002 03:00:00 GMT  
 Am I that stupid?
The issue is that I want an event to tell me when the selected item changes.
The click event only tells me when they click on the control.  The user
could re-select the same item that was already selected.  I only care when
they actually select an item that is different from the one that was
selected previously.

Let's say I have a control with years in it.  If the current selected value
is 2000, the user could click on the arrow in the control, re-select the
value of 2000.  This will cause the click event to trigger.  However, my
program doesn't need to do anything if they select the same value that was
already there.  That is why I store the value in a module level variable on
the focus event, so I know what the "before" value is, and then on the click
event I compare the before value to the current value.

So, there is a definite difference between a click event and a change event.
That is why I said the control was lacking in functionality.

-jeffie


Quote:
> What functionality do you feel is lacking? I' haven't had any
> troubles with it (other than you use the Click event rather than
> the Change event).

> --

> ~~~~~~~~~~~~~~~~~~~~
> "For every action, there is an equal and opposite criticism."



> > Is it just me or is there no way to tell when a user changes the
> selection
> > in a ComboBox control set to style "2 - Dropdown List".  It
> seems most of
> > the events are disabled in this mode.

> > To accomplish this I store the value in the control using the
> gotfocus event
> > and then on the click event, check to see if the value in the
> control is now
> > different.  Shouldn't it be easier than that?

> > Let me know if I'm just a little thick in the skull or the
> ComboBox control
> > is a little lacking in functionality.

> > -jeffie





Tue, 17 Sep 2002 03:00:00 GMT  
 Am I that stupid?

Private Sub Combo1_Click()

   If Combo1.Tag <> Combo1.List(Combo1.ListIndex) Then
       Debug.Print Combo1.List(Combo1.ListIndex) 'Shows the item that the user selected
       Combo1.Tag = Combo1.List(Combo1.ListIndex)
   End If

End Sub

Quote:

> The issue is that I want an event to tell me when the selected item changes.
> The click event only tells me when they click on the control.  The user
> could re-select the same item that was already selected.  I only care when
> they actually select an item that is different from the one that was
> selected previously.

> Let's say I have a control with years in it.  If the current selected value
> is 2000, the user could click on the arrow in the control, re-select the
> value of 2000.  This will cause the click event to trigger.  However, my
> program doesn't need to do anything if they select the same value that was
> already there.  That is why I store the value in a module level variable on
> the focus event, so I know what the "before" value is, and then on the click
> event I compare the before value to the current value.

> So, there is a definite difference between a click event and a change event.
> That is why I said the control was lacking in functionality.

> -jeffie



> > What functionality do you feel is lacking? I' haven't had any
> > troubles with it (other than you use the Click event rather than
> > the Change event).

> > --

> > ~~~~~~~~~~~~~~~~~~~~
> > "For every action, there is an equal and opposite criticism."



> > > Is it just me or is there no way to tell when a user changes the
> > selection
> > > in a ComboBox control set to style "2 - Dropdown List".  It
> > seems most of
> > > the events are disabled in this mode.

> > > To accomplish this I store the value in the control using the
> > gotfocus event
> > > and then on the click event, check to see if the value in the
> > control is now
> > > different.  Shouldn't it be easier than that?

> > > Let me know if I'm just a little thick in the skull or the
> > ComboBox control
> > > is a little lacking in functionality.

> > > -jeffie





Tue, 17 Sep 2002 03:00:00 GMT  
 Am I that stupid?

Quote:
> The issue is that I want an event to tell me when the selected item
changes.
> The click event only tells me when they click on the control.  The user
> could re-select the same item that was already selected.  I only care when
> they actually select an item that is different from the one that was
> selected previously.

Try this

    Private Sub Combo1_Click()
        Static CurrentIndex As Long
        If Combo1.ListIndex <> CurrentIndex Then
            ....    ' Here is your "change" event
            CurrentIndex = Combo1.ListIndex
        End If
    End Sub

The initial value of CurrentIndex will be zero, corresponding to the first
item if any.

Bertie



Tue, 17 Sep 2002 03:00:00 GMT  
 Am I that stupid?
I am using the click event without any problems.


Quote:
> The issue is that I want an event to tell me when the selected item
changes.
> The click event only tells me when they click on the control.  The user
> could re-select the same item that was already selected.  I only care when
> they actually select an item that is different from the one that was
> selected previously.

> Let's say I have a control with years in it.  If the current selected
value
> is 2000, the user could click on the arrow in the control, re-select the
> value of 2000.  This will cause the click event to trigger.  However, my
> program doesn't need to do anything if they select the same value that was
> already there.  That is why I store the value in a module level variable
on
> the focus event, so I know what the "before" value is, and then on the
click
> event I compare the before value to the current value.

> So, there is a definite difference between a click event and a change
event.
> That is why I said the control was lacking in functionality.

> -jeffie



> > What functionality do you feel is lacking? I' haven't had any
> > troubles with it (other than you use the Click event rather than
> > the Change event).

> > --

> > ~~~~~~~~~~~~~~~~~~~~
> > "For every action, there is an equal and opposite criticism."



> > > Is it just me or is there no way to tell when a user changes the
> > selection
> > > in a ComboBox control set to style "2 - Dropdown List".  It
> > seems most of
> > > the events are disabled in this mode.

> > > To accomplish this I store the value in the control using the
> > gotfocus event
> > > and then on the click event, check to see if the value in the
> > control is now
> > > different.  Shouldn't it be easier than that?

> > > Let me know if I'm just a little thick in the skull or the
> > ComboBox control
> > > is a little lacking in functionality.

> > > -jeffie





Sat, 21 Sep 2002 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Am I that stupid ?

2. Am I too stupid to program VBA?

3. How stupid am I being

4. How stupid am I being?

5. Am I stupid or is it VB? [Recordsets]

6. I am stupid but pleez help me

7. Am I Stupid ???

8. Am I Stupid ?...

9. Using MSMAPI ocx: Am I stupid or what?

10. Is the dataCombo control stupid or am I?

11. MDI-problem-am i stupid or is it a bug -2 icons in menubar

12. Am I stupid? :)

 

 
Powered by phpBB® Forum Software