0

Iv 10 Tables consisting of atleast 10 fields each in a single Database. Bt, Im only able to connect 1 table at a time to a form using an ADO Control. Im able to add data from table 'student' to textboxes in my form. Bt, hw can I add data from field(0) of Table 'Student' to Textbox1 and data from field(0) of Table 'Marks' to Textbox2 using VB6??

Private Sub Add_Click()
    If rs.State = 1 Then rs.Close
    rs.Open "select * from student", con, adOpenDynamic, adLockOptimistic
    rs.AddNew
    rs.Fields(0) = (Text1.Text)
    rs.Fields(1) = (Text2.Text)
    rs.Fields(2) = (Text13.Text)
    rs.Fields(3) = (Text4.Text)
    rs.Fields(4) = (Text5.Text)
    rs.Fields(5) = (Text6.Text)
    rs.Fields(6) = (Text7.Text)
    rs.Fields(7) = (Text8.Text)
    rs.Fields(8) = (Text9.Text)
    rs.Fields(9) = (Text10.Text)
    rs.Fields(10) = (Text11.Text)
    rs.Update
    MsgBox " Record Added"
End Sub

What can I do to add fields from 2 different tables to different text boxes within the same form using a single ado control using vb6 and MS Access 2007

Pls email me at : meera.athiyarath@gmail.com

Pls hlp!!

Edited by Reverend Jim: fixed code formatting

2
Contributors
1
Reply
13
Views
3 Years
Discussion Span
Last Post by G_Waddell
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.