Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox value in grid
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00139017
Message ID:
00139133
Views:
29
Michelle,

Why don't you have two logical fields in the table to begin with? They take up the same amount of space in the DBF as your string does. It would make it much easier to work with.

But I don't think a view is going to exactly help you because the view won't be able to convert the logical back to char to store in the table. You could use a view that does the char->logical conversion then in the "Save" process SCAN the cursor and do REPLACEs on the table the view is based on.

>I have a grid that is a checklist. It has two columns: the thing to be done and the check off. The values for the check column come from a character field in another table consisting of T & F. Each thing to be done has a key, and that key number translates to the position in the character string.
>
>For the checkbox, I made the control source:
>
>IIF(SUBSTR(repairview.ccheck,chkkey,1)="T", .T., .F.)
>
>This worked great for displaying the checklist. The problem came when I tried to un/check something. Having a calculated control source seems to make the checkbox read only. Obviously, it's not going to know how to change the value in the string, so I put code for that in the click event. But if I click on the checkbox, it just beeps and doesn't do the click event.
>
>So I set the control source to none, and put "this.value = " plus the IIF above in the refresh event. Unfortunately, it doesn't work dynamically. It takes the result of the first item on the checklist and puts that for all of them.
>
>Is there a way to set the value dynamically without using the control source?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform