R
Ranjith Kurian
My below code update the tables,
sometime if i update the data wrong and i need to correct it, so i would
like to create one more command button, on click of that it should match the
text box txtActivite.value and pull all other informations
(cboDate.Value,cboName.Value,txtStatus.Value,txtAudit.Value,cboAuditName.Value) and save the replace the new change to the table
Private Sub Command10_Click()
Dim db As Database
Dim rs As Recordset
Dim sqlstring As String
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl Master", dbOpenDynaset, dbAppendOnly)
With rs
..AddNew
..Fields("Date").Value = cboDate.Value
..Fields("Name").Value = cboName.Value
..Fields("Activite").Value = txtActivite.Value
..Fields("Status").Value = txtStatus.Value
..Fields("Audit").Value = txtAudit.Value
..Fields("Audit Name").Value = cboAuditName.Value
..Update
End With
Set rs = Nothing
Set db = Nothing
End Sub
sometime if i update the data wrong and i need to correct it, so i would
like to create one more command button, on click of that it should match the
text box txtActivite.value and pull all other informations
(cboDate.Value,cboName.Value,txtStatus.Value,txtAudit.Value,cboAuditName.Value) and save the replace the new change to the table
Private Sub Command10_Click()
Dim db As Database
Dim rs As Recordset
Dim sqlstring As String
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl Master", dbOpenDynaset, dbAppendOnly)
With rs
..AddNew
..Fields("Date").Value = cboDate.Value
..Fields("Name").Value = cboName.Value
..Fields("Activite").Value = txtActivite.Value
..Fields("Status").Value = txtStatus.Value
..Fields("Audit").Value = txtAudit.Value
..Fields("Audit Name").Value = cboAuditName.Value
..Update
End With
Set rs = Nothing
Set db = Nothing
End Sub