Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 22151

Get access records into TextBox!

$
0
0
hello guys
im working on database app. Here im supposed to get the data from the table(mdb file) of a particular ID key from user and put them into the text boxes
Code:

Private Sub Command3_Click()
Dim kdrsc As ADODB.Recordset
Set kdrsc = New ADODB.Recordset
Adodc1.RecordSource = "SELECT * FROM Killerx where ID=text4.text;"
Text5.Text = kdrsc.Fields("ID")
Text6.Text = kdrsc.Fields("Name")
Text7.Text = kdrsc.Fields("Branch")
kdrcs.Close
Set kdrsc = Nothing
End Sub

later on i have update this data into the record with command click event:
Code:

Private Sub Command4_Click()
Dim kdrsc As ADODB.Recordset
Set kdrsc = New ADODB.Recordset
kdrsc.Fields("ID") = "text5.text"
kdrsc.Fields("Name") = "text6.text"
kdrsc.Fields("Branch") = "text7.text"
kdrsc.Update
kdrsc.Close
Set kdrcs = Nothing
End Sub

but i seem to be getting a error in this program can anyone help with the correction?
ERROR: the item cannot be found in the collection corresponding to requested name or ordinal.

Viewing all articles
Browse latest Browse all 22151

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>