Subject Re: combobox / msgbox
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Sun, 18 Feb 2024 16:20:32 +0530
Newsgroups dbase.getting-started

Good Afternoon Michel,

> I have the following issue :
> I have a combobox (style 1 DropDown) with and OnChange event like below :
>
> function MYCOMBOBOX_OnChange
>     if form.myRowset.findkey(uper(this.value))        
>        // some code
>     else
>        msgbox("Not Found", "Check", 0 + 16)
>        return
>     endif
> return
>
> When entering wrong data (directly in the box, without opening it) and going to next field in the form by pressing TAB key, msgbox opens normally. But if going to next field by pressing ENTER key (CUAENTER is OFF), msgbox doesn't open (as if enter key was applied directly to the msgbox), and then I have no warning.
>
> What am I missing ?

I am late to this discussion. (Frankly speaking I just read some threads
and rarely reply.)

I was coding something with a combobox and so this struck my mind.

There are multiple events associated with a combobox.
onChange is one of them

BUT my preference is
onChange_committed.

(Please check the spelling I may be wrong)

There is a slight difference between the two

onChange fires with every change be it scrolling or anything.

onChangeCommitted fires when the user tries to commit the change.

It may or may not help you. But this the reason for my preference.

Regards
Akshat