need help with combobox and tables

need help with combobox and tables

Post by m_d7 » Thu, 04 May 2000 04:00:00



hi all

i have a combobox that get customer# from a table (the customer#
is a ForignKey in this table)
and there is another table in another form that have details of
the customer (number PrimaryKey,name,address,phone..)
i want the combobox to get customer# from the first table but
the data that is shown is the customer name
and when i choose a name from the combobox and press save button
the customer# is added to the first table

i dont know if i can do it or not
if you now please help me to do it

sorry for my poor English
m_d77

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

 
 
 

need help with combobox and tables

Post by Thomas O. Basco » Fri, 05 May 2000 04:00:00


Do you want to show customer *name* in the combobox and, when a name is selected, get the
customer *numer*? Then do this:

Combo.AddItem "Fritz Schmidt"                 ' Customer name
Combo.ItemData(Combo.NewIndex)=12345677 ' Customer number

Combo.ItemData(Combo.ListIndex)  contains the customer *number* associated
with the customer *name* which was selected from the Combo


>hi all

>i have a combobox that get customer# from a table (the customer#
>is a ForignKey in this table)
>and there is another table in another form that have details of
>the customer (number PrimaryKey,name,address,phone..)
>i want the combobox to get customer# from the first table but
>the data that is shown is the customer name
>and when i choose a name from the combobox and press save button
>the customer# is added to the first table

>i dont know if i can do it or not
>if you now please help me to do it

>sorry for my poor English
>m_d77

>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
>The fastest and easiest way to search and participate in Usenet - Free!