Set rs = "SELECT * from tblTraining" _
& " WHERE PersonID = " & Me.txtPersonID _
& " AND DocumentNumber = " & Me.txtDocumentNumber
& " AND TrainingStatus = " "Training Document Issued"""
I actually do not want it to overwrite the record. The user
enters a history and prints a report (training document) (which
makes Traiinng Status be "Training Document Issued")
then a few weeks later they come back in, change the status to
training complete and enter the completion date.
Thanks
Titania
Bob Quintal said:
That query contains FIVE (5) source tables. That's probably one
of the problems.
Instead of writing to recordsetClone in your CmdClose_Click sub,
try writing to the relevant table (tblTraining) directly, using a
Where clause to select the correct record.
Set rs = "SELECT * from tblTraining" _
& " WHERE PersonID = " & me.txtPersonID _
& " AND DocumentNumber = & & me.txtdocumentNumber _
& " AND TrainingStatus)= ""Training Document Issued"""
rs.HistoryTrainedTo = Me![txtHistoryTrainedTo]
rs.TrainingDate = Me![txtTrainingDate]
rs.TrainingStatus = Me![cmbTrainingStatus]
DoCmd.Close
I also believe you should be creating a new row in tblTraining
for each time the employee is retrained, not updating the
existing row, which is what happens now, and what your code was
attempting to do.
Q