AnotherNovice1
Systems Engineer
Hello everyone,
Is it possible to have a DBF file with some values (e.g. field01...field16 with bool values) and
assign that value (and enabling the checkbox) to a checkbox with similar naming?
The code for the loop doesn't seem to work, the values aren't set, the checboxes are disabled.
My form contains checkboxes with the naming "_chkV01" until "_chkV16".
My example code for that loop:
If I do things normally like this (16 times...):
But it feels so wrong.
EDIT: Ok, it worked, I forgot about another function which checks if the values are plausible...
That was the culprit of it.
Is it possible to have a DBF file with some values (e.g. field01...field16 with bool values) and
assign that value (and enabling the checkbox) to a checkbox with similar naming?
The code for the loop doesn't seem to work, the values aren't set, the checboxes are disabled.
My form contains checkboxes with the naming "_chkV01" until "_chkV16".
My example code for that loop:
Code:
SELECT <DBF-file>
SET ORDER TO <order-field>
SEEK <order-value>
IF FOUND()
FOR i = 1 TO 16
oCheckboxValue = EVALUATE("thisform._chkV"+STRTRAN(STR(i,2),' ','0'))
oCheckboxValue.Enabled = IIF(EVALUATE("value"+STRTRAN(STR(i,2),' ','0')),.T.,.F.)
oCheckboxValue.Value = IIF(EVALUATE("value"+STRTRAN(STR(i,2),' ','0')),1,0)
ENDFOR
ENDIF
If I do things normally like this (16 times...):
Code:
thisform._chkV01.Value = IIF(value01,1,0)
But it feels so wrong.
EDIT: Ok, it worked, I forgot about another function which checks if the values are plausible...
That was the culprit of it.