Hi all.
I've this problem. In the MAIN.PRG I use
ON KEY LABEL F10 xfnClickSave()
where xfnClickSave() is a function which moves the Focus to the SAVE button and performs the Click() method. This allows the user to press F10 to save the data.
Now all works fine but, sometimes, I get this error
Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event.
Chiamanti: D:\RADAR\E-RADAR.EXE
PROCEDURE APPLICATION.XPROCDO
PROCEDURE APPTOOLBAR.CMDRICAMBI.CLICK
MENUMOVR.MPX
PROCEDURE APPLICATION.XPROCXDOFORMFORSTARTUP
PROCEDURE APPLICATION.XPROCXDOFORM
PROCEDURE FRMADMAG.QUERYINTERVENTO.TXTEDIT.VALID
PROCEDURE APPLICATION.XPROCRADARRLOCK
PROCEDURE XFNCLICKSAVE FUNCS.FXP
This happens because the XFNCLICKSAVE function, which performs the SetFocus instructions, is called during the FRMADMAG.QUERYINTERVENTO.TXTEDIT.VALID method... but I DO NOT CALL IT IN THE VALID... it happens time to time and I do not know how to avoid it... I'm not able to replicate it.
Is there someone who has already faced this kind of problem ?
It looks like a 'timing' problem... the F10 event starts when the valid is running...
Thanks.
Ciao.
Marco (Italy)
marco.dicesare@elmec.it
I've this problem. In the MAIN.PRG I use
ON KEY LABEL F10 xfnClickSave()
where xfnClickSave() is a function which moves the Focus to the SAVE button and performs the Click() method. This allows the user to press F10 to save the data.
Now all works fine but, sometimes, I get this error
Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event.
Chiamanti: D:\RADAR\E-RADAR.EXE
PROCEDURE APPLICATION.XPROCDO
PROCEDURE APPTOOLBAR.CMDRICAMBI.CLICK
MENUMOVR.MPX
PROCEDURE APPLICATION.XPROCXDOFORMFORSTARTUP
PROCEDURE APPLICATION.XPROCXDOFORM
PROCEDURE FRMADMAG.QUERYINTERVENTO.TXTEDIT.VALID
PROCEDURE APPLICATION.XPROCRADARRLOCK
PROCEDURE XFNCLICKSAVE FUNCS.FXP
This happens because the XFNCLICKSAVE function, which performs the SetFocus instructions, is called during the FRMADMAG.QUERYINTERVENTO.TXTEDIT.VALID method... but I DO NOT CALL IT IN THE VALID... it happens time to time and I do not know how to avoid it... I'm not able to replicate it.
Is there someone who has already faced this kind of problem ?
It looks like a 'timing' problem... the F10 event starts when the valid is running...
Thanks.
Ciao.
Marco (Italy)
marco.dicesare@elmec.it