you forgot to addnew in this code
Code:
Private Sub Command3_Click()
rs1.Open "select * from table1 where nid = " & Trim(Text1.Text), con, adOpenDynamic, adLockOptimistic
rs1.AddNew
rs1.Fields("no") = Val(List1.Text) // save the item in table
MsgBox "added"
rs1.Update
rs1.Close
End Sub
and there i no need of red line in this code
Code:
//to retrieve the item
Private Sub Command1_Click()
rs1.Open "select * from table1 where nid = " & Trim(Text1.Text), con, adOpenDynamic, adLockOptimistic
'rs1.AddNew
Text1.Text = rs1.Fields("nid")
Text3.Text = rs1.Fields("no") //get that item form table
'rs1.Update
rs1.Close