Subject Re: combobox / msgbox
From Mervyn Bick <invalid@invalid.invalid>
Date Thu, 15 Feb 2024 16:39:29 +0200
Newsgroups dbase.getting-started

On 2024/02/15 13:57, Michel wrote:
> Mervyn Bick Wrote:
>
>> On 2024/02/15 10:50, Michel wrote:
>>> Hello,
>>> 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

> thanks for reply Meryn
> Combobox onChange event is really fired : I put an ?"we come here" at the beginning of  the onChange routine and another one ?"ready for msgbox" in the if condition just before msgbox line code and it is well written in the Command Window

If the onChange event handler is being executed but the message box is
not being displayed it suggests that oRef.findkey(upper(this.value)) is
returning true.

If your "ready for msgbox" message appears in the Results panel then the
msgbox should have opened.  If it didn't open then something strange is
happening.

Remove the return immediately before the endif (it really shouldn't be
there but, in theory anyway shouldn't do any harm) and see if it makes a
difference.

Mervyn.