From: Rick on
How do I get the datacombo to display one value and return another.

Right now I have this but it displays and returns the same value.

Set DataCombo1.RowSource = mrsCustTA
DataCombo1.ListField = "Description"

Thanks for any help you can give.


From: Ole Weigelt on
Do you want to return another Value from your list or do you i.e. want to
display the Name in the Combo and return an ID?

In the first case, use a setoff in the index, in the second case, use the
ItemData property. ItemData is a Long that can be accessed through the
ListIndex.

Example from VB Help:

Private Sub Form_Load ()
' List1 und ItemData-Datenfeld synchronisiert mit
' entsprechenden Elementen in sortierter Reihenfolge auff?llen.
List1.AddItem "Anette Schachtner"
List1.ItemData(List1.NewIndex) = 42310
List1.AddItem "Benno Overk?mping"
List1.ItemData(List1.NewIndex) = 52855
List1.AddItem "Dirk L?hn"
List1.ItemData(List1.NewIndex) = 64932
List1.AddItem "Michael Salatablatt"
List1.ItemData(List1.NewIndex) = 39227
End Sub

Private Sub List1_Click ()
' Angestelltennummer und Angestelltenname anf?gen.
Msg = List1.ItemData(List1.ListIndex) & " "
Msg = Msg & List1.List(List1.ListIndex)
Label1.Caption = Msg
End SubIf that does not work, because you need strings or more info, use a
database. Use the ItemData property for the primary key to your table and
you have all the space in the world...
Hope that helpsOle
"Rick" <rick(a)di-wave.com> schrieb im Newsbeitrag
news:%23GBvvEvKGHA.2392(a)TK2MSFTNGP09.phx.gbl...
> How do I get the datacombo to display one value and return another.
>
> Right now I have this but it displays and returns the same value.
>
> Set DataCombo1.RowSource = mrsCustTA
> DataCombo1.ListField = "Description"
>
> Thanks for any help you can give.
>
>


From: Rick on
Thanks for your reply. But I figured out what I needed it is the
BoundColumn property.

Thanks again!!!


"Ole Weigelt" <o.weigelt(a)officeworks.de> wrote in message
news:OceGFTxKGHA.344(a)TK2MSFTNGP11.phx.gbl...
> Do you want to return another Value from your list or do you i.e. want to
> display the Name in the Combo and return an ID?
>
> In the first case, use a setoff in the index, in the second case, use the
> ItemData property. ItemData is a Long that can be accessed through the
> ListIndex.
>
> Example from VB Help:
>
> Private Sub Form_Load ()
> ' List1 und ItemData-Datenfeld synchronisiert mit
> ' entsprechenden Elementen in sortierter Reihenfolge auff?llen.
> List1.AddItem "Anette Schachtner"
> List1.ItemData(List1.NewIndex) = 42310
> List1.AddItem "Benno Overk?mping"
> List1.ItemData(List1.NewIndex) = 52855
> List1.AddItem "Dirk L?hn"
> List1.ItemData(List1.NewIndex) = 64932
> List1.AddItem "Michael Salatablatt"
> List1.ItemData(List1.NewIndex) = 39227
> End Sub
>
> Private Sub List1_Click ()
> ' Angestelltennummer und Angestelltenname anf?gen.
> Msg = List1.ItemData(List1.ListIndex) & " "
> Msg = Msg & List1.List(List1.ListIndex)
> Label1.Caption = Msg
> End SubIf that does not work, because you need strings or more info, use a
> database. Use the ItemData property for the primary key to your table and
> you have all the space in the world...
> Hope that helpsOle
> "Rick" <rick(a)di-wave.com> schrieb im Newsbeitrag
> news:%23GBvvEvKGHA.2392(a)TK2MSFTNGP09.phx.gbl...
>> How do I get the datacombo to display one value and return another.
>>
>> Right now I have this but it displays and returns the same value.
>>
>> Set DataCombo1.RowSource = mrsCustTA
>> DataCombo1.ListField = "Description"
>>
>> Thanks for any help you can give.
>>
>>
>
>