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:
00457411
Vues:
17
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
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.
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform