Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim bid As Integer
Private Sub cboBoid_Change()
bid = (cboBoid.Text)
Dim res As New ADODB.Recordset
res.Open "select * from Customer_order where Bookorder_id=' " & bid & " ' ", con, adOpenKeyset, adLockOptimistic
res.Open "Select * from Customer_book_order_details Bookorder_id=' " & bid & " ' ", con, adOpenKeyset, adLockOptimistic
res.MoveFirst
While (res.EOF <> True)
If (res(0) = bid) Then
txtCustname.Text = (res("Cust_name"))
txtAdvance.Text = (res("Advance_pay"))
txtBname.Text = (res("Bookname"))
txtAuthor.Text = (res("Author"))
txtQuantity.Text = (res("Quantity"))
res.MoveNext
End If
Wend
res.Close
End Sub
Private Sub Form_Load()
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.Open App.Path & "\Bookshop.mdb"
rs.ActiveConnection = con
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.Open "SELECT * FROM Customer_order"
With rs1
.ActiveConnection = con
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "SELECT * FROM Customer_order_payment"
End With
With rs2
.ActiveConnection = con
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "SELECT * FROM Customer_book_order_details"
End With
End Sub
i am trying to retrieve data from three different tables which are mentioned in form load event........when i will select id from cboBoid.text the info from three different tables should be displayed in respective textboxes.....but i am not able to do that.I am not getting any error but data is not getting displayed......plz help.....i am using vb 6.0 and ms access 2007.....thanks!......
Dim rs As New ADODB.Recordset
Dim bid As Integer
Private Sub cboBoid_Change()
bid = (cboBoid.Text)
Dim res As New ADODB.Recordset
res.Open "select * from Customer_order where Bookorder_id=' " & bid & " ' ", con, adOpenKeyset, adLockOptimistic
res.Open "Select * from Customer_book_order_details Bookorder_id=' " & bid & " ' ", con, adOpenKeyset, adLockOptimistic
res.MoveFirst
While (res.EOF <> True)
If (res(0) = bid) Then
txtCustname.Text = (res("Cust_name"))
txtAdvance.Text = (res("Advance_pay"))
txtBname.Text = (res("Bookname"))
txtAuthor.Text = (res("Author"))
txtQuantity.Text = (res("Quantity"))
res.MoveNext
End If
Wend
res.Close
End Sub
Private Sub Form_Load()
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.Open App.Path & "\Bookshop.mdb"
rs.ActiveConnection = con
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.Open "SELECT * FROM Customer_order"
With rs1
.ActiveConnection = con
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "SELECT * FROM Customer_order_payment"
End With
With rs2
.ActiveConnection = con
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "SELECT * FROM Customer_book_order_details"
End With
End Sub
i am trying to retrieve data from three different tables which are mentioned in form load event........when i will select id from cboBoid.text the info from three different tables should be displayed in respective textboxes.....but i am not able to do that.I am not getting any error but data is not getting displayed......plz help.....i am using vb 6.0 and ms access 2007.....thanks!......