Code:
Private Sub cmdadd_Click()
If Len(Trim(Text1.Text)) > 0 Then
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("date") = Text1.Text
Adodc1.Recordset.Fields("Customer Name") = Text2.Text
Adodc1.Recordset.Fields("amount") = Text3.Text
Adodc1.Recordset.Update
Adodc1.RecordSource = "SELECT * FROM Table1"
Adodc1.Caption = Adodc1.RecordSource
Else
MsgBox "Please Insert Date"
End If
End Sub
use this to add records
for deleting the selected row use this
Code:
Private Sub Command1_Click()
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete
Else
MsgBox "no record found"
End If
End Sub