Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo list-storing to a database

Status
Not open for further replies.

rene316

Programmer
Jan 14, 2002
81
US
Hello,
When you use a drop down combo box, is there a way to store the option selected to a database. I will be using an ADO control and be attached to an Access database. I am going to have my employees names in the drop down combo box. So say I select John, I want it to store "John" to a name field in the database. Also, I would need it to retieve the value stored in the combo box when I retrieve the record. I am trying to minimize the typing they will be doing, although I know it would be simpler just to have them type it into a text box and just store it like that.

Thx in advance,
Rene
 
If its an ADO control just bind the combo box to the ADO control so when addnew is invoked it will add the selected item. Otherwise if it is done at runtime then

ADOrs.recordset.fields(1) = combobox.text

To see this working add a combo box to a form adn add some items to it then run the form. Select an item in the list then break into the code (F8) and in the immediate window type in

?cboname.text

that should then show you the selected item.

:) 'mi casa es su casa'
]-=tty0=-[
ICQ:82621399
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top