PC Review


Reply
Thread Tools Rate Thread

Determining how a combo box got selected

 
 
Juan Galvez
Guest
Posts: n/a
 
      5th Mar 2004
Hello everyone,

How can I determine whether a combo box got selectd from the user's exiting
the last control or by the user clicking on it directly? The GotFocus event
on the combo would be the ideal place, but it triggers before the MouseDown
event. I need to do a "mouse clicked?" check before the GotFocus event, not
afterwards. Since the previous control has the focus by default, using the
LeftFocus event on it doesn't work either because the click takes place on
the next control (the combo box)... help?

Thanks in advance,


Juan Galvez



 
Reply With Quote
 
 
 
 
Mark Phillipson
Guest
Posts: n/a
 
      5th Mar 2004
Hi,

Try using the AfterUpdate Event instead. This will only fire when the combo
box is updated.

HTH

--

Cheers
Mark

Free Access/Office Add-Ins at:
http://mphillipson.users.btopenworld.com/



"Juan Galvez" <(E-Mail Removed)> wrote in message
news:eMZ1c.502$(E-Mail Removed)...
> Hello everyone,
>
> How can I determine whether a combo box got selectd from the user's

exiting
> the last control or by the user clicking on it directly? The GotFocus

event
> on the combo would be the ideal place, but it triggers before the

MouseDown
> event. I need to do a "mouse clicked?" check before the GotFocus event,

not
> afterwards. Since the previous control has the focus by default, using

the
> LeftFocus event on it doesn't work either because the click takes place on
> the next control (the combo box)... help?
>
> Thanks in advance,
>
>
> Juan Galvez
>
>
>



 
Reply With Quote
 
Juan Galvez
Guest
Posts: n/a
 
      5th Mar 2004
Hi Mark,

The problem is that I need some actions to take place when the user clicks
on the combo instead of tabbing (or after updating) from the previous
control (an option group). The user will not necessarily be updating the
combo, so the AfterUpdate would not always be used. If the user gets to the
combo box from updating the option group (which precedes it in the tab
order), then the updates will have taken place. However, if the user jumps
directly to the combo by clicking on it with the mouse, I want a different
set of updates to take place. That's why I need to know how the user got to
the combo in the first place.

I thought about using the LostFocus or Exit events from the combo box, but
I'm in the same predicament: How do I know whether the user is moving
between controls by clicking when the click events take place when the focus
is inside the control already?



"Mark Phillipson" <(E-Mail Removed)> wrote in message
news:%23C0$%(E-Mail Removed)...
> Hi,
>
> Try using the AfterUpdate Event instead. This will only fire when the

combo
> box is updated.
>
> HTH
>
> --
>
> Cheers
> Mark
>
> Free Access/Office Add-Ins at:
> http://mphillipson.users.btopenworld.com/
>
>
>
> "Juan Galvez" <(E-Mail Removed)> wrote in message
> news:eMZ1c.502$(E-Mail Removed)...
> > Hello everyone,
> >
> > How can I determine whether a combo box got selectd from the user's

> exiting
> > the last control or by the user clicking on it directly? The GotFocus

> event
> > on the combo would be the ideal place, but it triggers before the

> MouseDown
> > event. I need to do a "mouse clicked?" check before the GotFocus event,

> not
> > afterwards. Since the previous control has the focus by default, using

> the
> > LeftFocus event on it doesn't work either because the click takes place

on
> > the next control (the combo box)... help?
> >
> > Thanks in advance,
> >
> >
> > Juan Galvez
> >
> >
> >

>
>



 
Reply With Quote
 
Mark Phillipson
Guest
Posts: n/a
 
      5th Mar 2004
If you create a form level boolean variable and when the form loads set to
False. Then in the AfterUpdate Event of the Option Group set it to True.
Then you know if the user has updated the Option Group.

HTH
Mark.

"Juan Galvez" <(E-Mail Removed)> wrote in message
news:6C%1c.505$(E-Mail Removed)...
> Hi Mark,
>
> The problem is that I need some actions to take place when the user clicks
> on the combo instead of tabbing (or after updating) from the previous
> control (an option group). The user will not necessarily be updating the
> combo, so the AfterUpdate would not always be used. If the user gets to

the
> combo box from updating the option group (which precedes it in the tab
> order), then the updates will have taken place. However, if the user

jumps
> directly to the combo by clicking on it with the mouse, I want a different
> set of updates to take place. That's why I need to know how the user got

to
> the combo in the first place.
>
> I thought about using the LostFocus or Exit events from the combo box, but
> I'm in the same predicament: How do I know whether the user is moving
> between controls by clicking when the click events take place when the

focus
> is inside the control already?
>
>
>
> "Mark Phillipson" <(E-Mail Removed)> wrote in message
> news:%23C0$%(E-Mail Removed)...
> > Hi,
> >
> > Try using the AfterUpdate Event instead. This will only fire when the

> combo
> > box is updated.
> >
> > HTH
> >
> > --
> >
> > Cheers
> > Mark
> >
> > Free Access/Office Add-Ins at:
> > http://mphillipson.users.btopenworld.com/
> >
> >
> >
> > "Juan Galvez" <(E-Mail Removed)> wrote in message
> > news:eMZ1c.502$(E-Mail Removed)...
> > > Hello everyone,
> > >
> > > How can I determine whether a combo box got selectd from the user's

> > exiting
> > > the last control or by the user clicking on it directly? The GotFocus

> > event
> > > on the combo would be the ideal place, but it triggers before the

> > MouseDown
> > > event. I need to do a "mouse clicked?" check before the GotFocus

event,
> > not
> > > afterwards. Since the previous control has the focus by default,

using
> > the
> > > LeftFocus event on it doesn't work either because the click takes

place
> on
> > > the next control (the combo box)... help?
> > >
> > > Thanks in advance,
> > >
> > >
> > > Juan Galvez
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Juan Galvez
Guest
Posts: n/a
 
      5th Mar 2004
Perfect. Thank you.

Juan

"Mark Phillipson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If you create a form level boolean variable and when the form loads set to
> False. Then in the AfterUpdate Event of the Option Group set it to True.
> Then you know if the user has updated the Option Group.
>
> HTH
> Mark.
>
> "Juan Galvez" <(E-Mail Removed)> wrote in message
> news:6C%1c.505$(E-Mail Removed)...
> > Hi Mark,
> >
> > The problem is that I need some actions to take place when the user

clicks
> > on the combo instead of tabbing (or after updating) from the previous
> > control (an option group). The user will not necessarily be updating

the
> > combo, so the AfterUpdate would not always be used. If the user gets to

> the
> > combo box from updating the option group (which precedes it in the tab
> > order), then the updates will have taken place. However, if the user

> jumps
> > directly to the combo by clicking on it with the mouse, I want a

different
> > set of updates to take place. That's why I need to know how the user

got
> to
> > the combo in the first place.
> >
> > I thought about using the LostFocus or Exit events from the combo box,

but
> > I'm in the same predicament: How do I know whether the user is moving
> > between controls by clicking when the click events take place when the

> focus
> > is inside the control already?
> >
> >
> >
> > "Mark Phillipson" <(E-Mail Removed)> wrote in message
> > news:%23C0$%(E-Mail Removed)...
> > > Hi,
> > >
> > > Try using the AfterUpdate Event instead. This will only fire when the

> > combo
> > > box is updated.
> > >
> > > HTH
> > >
> > > --
> > >
> > > Cheers
> > > Mark
> > >
> > > Free Access/Office Add-Ins at:
> > > http://mphillipson.users.btopenworld.com/
> > >
> > >
> > >
> > > "Juan Galvez" <(E-Mail Removed)> wrote in message
> > > news:eMZ1c.502$(E-Mail Removed)...
> > > > Hello everyone,
> > > >
> > > > How can I determine whether a combo box got selectd from the user's
> > > exiting
> > > > the last control or by the user clicking on it directly? The

GotFocus
> > > event
> > > > on the combo would be the ideal place, but it triggers before the
> > > MouseDown
> > > > event. I need to do a "mouse clicked?" check before the GotFocus

> event,
> > > not
> > > > afterwards. Since the previous control has the focus by default,

> using
> > > the
> > > > LeftFocus event on it doesn't work either because the click takes

> place
> > on
> > > > the next control (the combo box)... help?
> > > >
> > > > Thanks in advance,
> > > >
> > > >
> > > > Juan Galvez
> > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining row # of selected cell =?Utf-8?B?Qm9i?= Microsoft Excel Programming 2 25th Sep 2007 12:28 PM
I have a problem with determining if a shape is selected. =?Utf-8?B?QW5keVQ=?= Microsoft Excel Programming 6 16th May 2007 06:37 PM
Determining if a chart is selected roybrew@att.net Microsoft Excel Charting 2 25th Jan 2005 03:06 PM
determining selected columns in datasheet Malcolm Cook Microsoft Access 0 5th May 2004 04:51 AM
Determining selected worksheet Bob Conar Microsoft Excel Programming 3 20th Oct 2003 01:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:51 AM.