Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optiongroup.Controlsource = a logical field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Optiongroup.Controlsource = a logical field
Divers
Thread ID:
00057117
Message ID:
00057117
Vues:
102
Not supposed to do that, since the value is numeric. But I want the effect of that. Consider a table of people with a logical sex field, where .T. is considered female and .F. male. To FoxPro, such a field means "female, true or false." But imagine a form with a check box and a caption "Female?" Looks pretty dumb. The appropriate control is an option group with one button labeled "male" and the other "female."

I left the optiongroup.ControlSource blank, then set Option2.ControlSource = mytable.female and Option1.ControlSource = !mytable.female. That almost worked. When I navigated the table with my form, the option buttons updated correctly. But when I tried to edit a record, the buttons wouldn't switch. When I edited a female record and clicked the male option button, the female button turned off but the male button didn't turn on. Then it didn't save the change.

I know I can use code in the OptionGroup.Click and the Form.Refresh to update the controlsource, but I like controlsources. Can it be done?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform