Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array property in ComboBoxes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01106369
Message ID:
01106731
Vues:
27
>>>>>>>>In order to avoid "cannot access selected table" error messages, I read that it's best to add an array property to each ComboBox and set it's rowsourcetype to array, is this recommended here?
>>>>>>>
>>>>>>>I have some problems with array as RowSource for combobox. One is that it could not handle NULL in the data. Second that it adds an empty phantom record if your ControlSource field is empty. Other than that it's fine.
>>>>>>
>>>>>> If I add an array property in my combobox baseclass and call it say "arryX(1)" , won't this cause multiple references if I have several comboboxes on the same form?
>>>>>
>>>>>No, each array belongs to its own combobox <g> If this would not be true, how can you have multiple objects of the same class on the form, such as textbox? <g>
>>>>
>>>> How would I reference them in code, FOR EXAMPLE THISFORM.mycombobox1.ARRAx(1) ?
>>>
>>>Yes, though I assume that your combo's array has more than 1 dimension. I would assume that it more likely to have two: 1 for holding description and second for the actual field value.
>>
>>Naomi, it is 2 dim, by default I think. However an issue I'm having if I could run it by you. My table has 4 records, 1 with the text "BO" in it which I do not want to pick up, but the combobox displays it anyway, how come? The code is this
>>
>>WITH thisform.mycombobox2
>>.rowsourcetype=3
>>mycombobox2.rowsource="select * from office6 into ARRAY thisform.mycombobox2.arrayX where not 'BO' $ office order by office"
>>ENDW
>>thisform.mycombobox2.Refresh
>
>You're doing something strange here.
>Try this in the form's Init:
>select * from office6 into ARRAY thisform.mycombobox2.arrayX where not 'BO' $ office order by office
>
>For your combobox specify 5 as the RowSourceType and this.ArrayX as RowSource.
>
>After you've done with select requery your combo.

OK, accomplished and works! I guess the big diff was having rowsourcetype set to 5 instead of 3 like I had it. Thanks!
Hopefully this will avoid the prob of opening and changing work areas that have their source in my comboboxes and getting those pesky errors.

My combobox base class has this in it's init section
this.AddProperty("arrayX[1]")
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform