I have this code in the click event of a button which errors but only on the first time it is run, after that it works just fine.
This is a cut down version of a much more complex DOCASE arrangement but errors in the same way as the full version
When run, Field - ITEM (chr 7) is checked first and then Field COST (float) is checked and the error occurs
I am sure there will be comments about the code but as it is holding the job up, I will risk the wrath of the code police
Keith
This is a cut down version of a much more complex DOCASE arrangement but errors in the same way as the full version
When run, Field - ITEM (chr 7) is checked first and then Field COST (float) is checked and the error occurs
I am sure there will be comments about the code but as it is holding the job up, I will risk the wrath of the code police
Code:
NUMOFCON = THISFORM.MAINCON.CONTROLCOUNT
TESTED = 0
PASSED = 0
N=''
TV=0
v=''
FAULT=''
THISFORM.CODEIS.VISIBLE = .F.
WEBTRIG=ALLTRIM(THISFORM.MAINCON.WEB1.VALUE)
W = IIF(LEN(WEBTRIG) > 0,'WEBON', 'WEBOFF')
FOR NWHICH = 1 TO NUMOFCON
TESTED=TESTED+1
IF THISFORM.MAINCON.CONTROLS(NWHICH).CLASS = 'Standardfield' OR THISFORM.MAINCON.CONTROLS(NWHICH).CLASS = 'Standardmemo'
BX=THISFORM.MAINCON.CONTROLS(NWHICH)
A = 'GOOD'
N=UPPER(BX.NAME)
DO CASE
CASE N = 'ITEM'
A = IIF(LEN(ALLTRIM(V)) > 0,'GT', 'BT')
CASE N = 'COST'
*******************************************************************
* Error here
A = IIF(BX.VALUE > 0,'GT', 'BT')
*******************************************************************
ENDCASE
ENDIF
NEXT
Keith