Hi all,
This is what I'm trying to do.
A form with multiple controls. Users enter data, save it/ or open the form with saved data. Because a lot of cases, the data is pretty much the same, users just changes a couple things on the current record then hit button "Save as New Record" My problem is, access does not only save new data as new record but also save change to the previous record too. Can you help. Thanks a lot.
My sample codes:
Private Sub cmdSaveAsNew_Click()
'get current data
strJur = [Forms]![frmDataEntry]![txtJurCode]
strYear = [Forms]![frmDataEntry]![txtYear]
strSignedDate = [Forms]![frmDataEntry]![txtSignedDate]
'go open new record
DoCmd.GoToRecord acDataForm, "frmDataEntry", acNewRec
'copy data to form's controls of new record
[Forms]![frmDataEntry]![txtJurCode] = strJur
[Forms]![frmDataEntry]![txtYear] = strYear
[Forms]![frmDataEntry]![txtSignedDate] = strSignedDate
'save to table
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, acMenuVer70
This is what I'm trying to do.
A form with multiple controls. Users enter data, save it/ or open the form with saved data. Because a lot of cases, the data is pretty much the same, users just changes a couple things on the current record then hit button "Save as New Record" My problem is, access does not only save new data as new record but also save change to the previous record too. Can you help. Thanks a lot.
My sample codes:
Private Sub cmdSaveAsNew_Click()
'get current data
strJur = [Forms]![frmDataEntry]![txtJurCode]
strYear = [Forms]![frmDataEntry]![txtYear]
strSignedDate = [Forms]![frmDataEntry]![txtSignedDate]
'go open new record
DoCmd.GoToRecord acDataForm, "frmDataEntry", acNewRec
'copy data to form's controls of new record
[Forms]![frmDataEntry]![txtJurCode] = strJur
[Forms]![frmDataEntry]![txtYear] = strYear
[Forms]![frmDataEntry]![txtSignedDate] = strSignedDate
'save to table
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, acMenuVer70