Click to See Complete Forum and Search --> : Bind recordset to TextBox and ComboBox
alwsid
Aug 4th, 2000, 03:49 AM
Hi...
How to bind recordset to the textbox and combobox using ADO and Update my database.
My database C:\MyDb.mdb; My Table => Table1.
In Table1 I've 10 Fields; 7 tables using TextBox and 3 Tables using comboBox.
hope someone can help me.
DrewDog_21
Aug 4th, 2000, 09:12 AM
for textboxes, put this in the Form_Load routine
Set Text1.DataSource = myADO'recordset where you want to store info entered into the combo box
Text1.DataField = "MyField" 'target field name
for combo boxes it is a little differet
Set Combo1.DataSource = myADO 'recordset where you want to store info entered into the combo box
Set Combo1.RowSource = myOtherADO 'recordset that contains the data that you want to show in the combo box
Combo1.ListField = "ListField" 'field from myOtherADO that contains the values that you want to show in the combo box
Combo1.BoundColumn = "IdListField" 'field from myOtherADO that contains the values that you want to copy into the recordset myADO
Combo1.DataField = "IdDataField" 'field in myADO where you want to copy the values of the bound column
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.