Results 1 to 2 of 2

Thread: Bind recordset to TextBox and ComboBox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Location
    Malaysia
    Posts
    108
    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.


  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Talking

    for textboxes, put this in the Form_Load routine
    Code:
    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
    Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width