I have a form which is bound to a table. When there is a change on the record (there are about 10 fields including combo boxes) I want to move that record to a history table. I have figured out how to do it when a record is added but cannot figure out how to just add the changed record-it's adding every record in the table to the history table.
Here is the code I have so far.. I know I need to specify that changed record but I don't know how to do it.
DoCmd.RunSQL ("INSERT INTO tblIncidentHistory (IncidentNumber,IncidentDate,IncidentType,IncidentSeverity,IncidentRiskAssessment,IncidentResponsibility,IncidentDescription,IncidentStatus,DateResolved,DateReportedtoFDIC,DateCustomerCommunication,DateUpdated)
SELECT IncidentNumber,IncidentDate,IncidentType,IncidentSeverity,IncidentRiskAssessment,IncidentResponsibility,IncidentDescription,IncidentStatus,DateResolved,DateReportedtoFDIC,DateCustomerCommunication,#" & Now() & "# FROM tblIncident")
I'm a newbie at this so would appreciate any help. )
Here is the code I have so far.. I know I need to specify that changed record but I don't know how to do it.
DoCmd.RunSQL ("INSERT INTO tblIncidentHistory (IncidentNumber,IncidentDate,IncidentType,IncidentSeverity,IncidentRiskAssessment,IncidentResponsibility,IncidentDescription,IncidentStatus,DateResolved,DateReportedtoFDIC,DateCustomerCommunication,DateUpdated)
SELECT IncidentNumber,IncidentDate,IncidentType,IncidentSeverity,IncidentRiskAssessment,IncidentResponsibility,IncidentDescription,IncidentStatus,DateResolved,DateReportedtoFDIC,DateCustomerCommunication,#" & Now() & "# FROM tblIncident")
I'm a newbie at this so would appreciate any help. )