Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox - display one thing, store another
Message
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00457383
Message ID:
00457430
Vues:
21
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>How do I create a combobox in VB that will display one thing but store another - e.g., display a name, but be bound to a foreign key field?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>
>Hey Trey. The native VB combo box doesn't allow it. But, the kinda-quasi-native DataList Controls combo allows it. Just set the DataList Controls component as part of your project, and drop this field on your form [by drawing it or double-clicking it]. I thought I had a working example of this in action, but I can't find it right now... but, IIRC, the datafield specifies the bound field, while the ListField specifies... well, the list field. The DataSource property is where you actually store the ADO recordset name (the DataMember property would specify the recordset object if the DataSource specified a data environment... if indeed you were using one -- which I do not recommend).
>
>On the run right now, so no time to play with this and double-check. Let me know how it works out. Hope it helps.

Thanks, Vin.

I kinda figured there'd be a different control I would have to use.
I also have already determined that I probably won't use a DataEnvironment - doesn't take me long to look at a horseshoe <g>
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform