B
BLW
I have a form where I enter in accident information. When I save this form,
I want it to look into a another table (Accident Investigation) to see if an
investigation has been completed that matches the Case #. If no
investigation is found, I want it to add a task to the task list to remind
the user to complete the investigation.
Here is my code. What am I doing wrong? I keep getting "You canceled
Previous Operation"
Dim stDocName As String
If DCount("[Case]", "[Accident Investigation]", "[Case]=Me.[Case]") = 0
Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms(stDocName)![Task] = "Accident Investigation on " & Me.Employee
Forms(stDocName)![Due Date] = Me.Accident_Date + 3
DoCmd.Close
End If
DoCmd.Close
I want it to look into a another table (Accident Investigation) to see if an
investigation has been completed that matches the Case #. If no
investigation is found, I want it to add a task to the task list to remind
the user to complete the investigation.
Here is my code. What am I doing wrong? I keep getting "You canceled
Previous Operation"
Dim stDocName As String
If DCount("[Case]", "[Accident Investigation]", "[Case]=Me.[Case]") = 0
Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms(stDocName)![Task] = "Accident Investigation on " & Me.Employee
Forms(stDocName)![Due Date] = Me.Accident_Date + 3
DoCmd.Close
End If
DoCmd.Close