Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid subscript reference (Error 31)
Message
De
17/06/1998 16:19:59
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
16/06/1998 12:39:00
Tan Gay Cheong
Cybercomp Computer Services
Singapore, Singapour
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00108172
Message ID:
00109262
Vues:
58
>I think I have find the answer, I try to take out the customer.choice from the optiongroup1's controlsource property, and the problem solve.
>
>I don't know why we should leave the controlsource's property empty. But it works. Can explain why?

It should contain an integer, and your controlsource was character. The .value of an optiongroup is always an integer, which denotes the position of the button clicked, i.e. if you click optiongroup1.commandbutton2, then optiongroup1.value=2, for the second button.
All in all, I think you should have used a listbox or combo instead.

>I have replace the following codes in the click event.
>replace customer.choice with this.buttons(this.value).caption
>
>No more problems now.

Of course, but it won't work the other way 'round - when you display a record with some value, the corresponding button won't select automatically. You'd have to code around it in the optiongroup's refresh method, like this:

for i=1 to this.buttoncount
if customer.choice=this.buttons[i].caption
this.value=i
exit
endif
endfor

This is the reverse of what you do when you click on an individual button; when you click, you picked an integer (1,2,3... the ordinal number of the button), and assigned the customer.choice the caption of the button. This time we scan through the captions to find the one, and then pick its number.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform