Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Which event to use to detect combo-box selection?

Geek News

Which event to use to detect combo-box selection?
Dorian 12/19/2008 7:00:08 PM
Which is the best event to use to detect changes in a combo box selection?
I need to detect the date/time of every change to a combo box selection even
if it changes multiple times before the BeforeUpdate event.

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
Re: Which event to use to detect combo-box selection?
"Dirk Goldgar" <dg[ at ]NOdataSPAMgnostics.com.invalid> 12/19/2008 7:09:56 PM
"Dorian" <Dorian[ at ]discussions.microsoft.com> wrote in message
news:DF4DBCCF-0256-4417-B00E-39A78BC3F982[ at ]microsoft.com...
[Quoted Text]
> Which is the best event to use to detect changes in a combo box selection?
> I need to detect the date/time of every change to a combo box selection
> even
> if it changes multiple times before the BeforeUpdate event.


I assume by "BeforeUpdate event", you mean the BeforeUpdate event of the
form, not the combo box. But you want to know every time the user changes
selections in the combo box, even if they do it multiple times before saving
the record.

I'd use the control's AfterUpdate event for this. You certainly *don't*
want to use the Change event, because if the user types into the control
instead of using the mouse, the Change event will fire with every keystroke.
I believe you *could* use the Click event, because that event has been
jiggered to behave similarly to the AfterUpdate event; however, it seems to
me "AfterUpdate" explains itself much better.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Re: Which event to use to detect combo-box selection?
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 12/19/2008 7:14:48 PM
On Fri, 19 Dec 2008 11:00:08 -0800, Dorian <Dorian[ at ]discussions.microsoft.com>
wrote:

[Quoted Text]
>Which is the best event to use to detect changes in a combo box selection?

The combo box's BeforeUpdate event (if you want to be able to cancel that
change), or its AfterUpdate event (if you want to do something with the value
after it's been saved to the table).
--

John W. Vinson [MVP]

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net