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
later on i have update this data into the record with command click event:
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.
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 SubCode:
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 SubERROR: the item cannot be found in the collection corresponding to requested name or ordinal.