Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checkbox reacts to Y/N field
Message
De
29/01/2007 08:41:49
 
 
À
29/01/2007 08:15:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01189996
Message ID:
01190028
Vues:
17
>>>>>>>Again part of the legacy system I'm changing, fopr some reason the author made a field that ellicits a Y/N answer C(1) and codes the original form to check for this, rather than making it logical. I want my new form to have a checkbox.
>>>>>>>
>>>>>>>Never come across this requirement before but I thought it would be achievable by putting the expression:
>>>>>>>
>>>>>>>=IIF( RteFam.Survey = "Y", .T., .F.)
>>>>>>>
>>>>>>>in the .Value property of the checkbox. It doesn't react at all. I tried:
>>>>>>>
>>>>>>>=IIF( RteFam.Survey = "Y", 1, 0)
>>>>>>>
>>>>>>>but that makes no difference either. Sure I know I can put code in a method to set the checkbox but I just wanted to do it simply, sans code.
>>>>>>>
>>>>>>>Why doesn't this work?
>>>>>>>
>>>>>>>'ppreciate it.
>>>>>>>
>>>>>>>Terry
>>>>>>
>>>>>>Terry,
>>>>>>
>>>>>>In the properties, try [ UPDATE, in the controlsource this is ]
>>>>>>
>>>>>>(RteFam.Survey = 'Y')
>>>>>>
>>>>>
>>>>>Thank you, Gregory
>>>>>
>>>>>I assume you mean in the .value property (if not, which else?)
>>>>
>>>>In the ControlSource of the checkbox !! (see UPDATE above)
>>>>
>>>>>I did that and got Data Type mismatch error. This is strange as the expression SHOULD yield T/F.
>>>
>>>Yes, thanks, that worked. BTW, the above error didn't happen when I put:
>>>
>>>= (RteFam.Survey = 'Y')
>>>
>>>That's all well and good. Trouble is, this is sort of contradicting the actual target control source, which is Y/N, not a logical. The form is has a grid page and details page. If I select a record that turns the checkbox on, then use the grid page to select another where the reord val = "N", then return to the details page, the previous F value still shows in the checkbox.
>>
>>Terry,
>>
>>I would say that in the details' page activate, you have to put: =m.this.Refresh()
>
>Thank you. Do you not see my point, though that this is not specifying a controlsource, rather just saying it is logical, which it is not?
>
>In any account, I've decided to set it via code, in my form's "next record" bespoke methos, in which I do other stuff anyway.


That's the easy way. What is wrong with setting the controlsource ?

>Thanks for your attention
>
>Terry
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform