L
Lostguy
Hello!
I put this into the AfterUpdate event of the EmployeeIDfk combobox on
the continuous subform.
(I have Date and Event on the mainform, and then select Employees on
the subform. Since Event and Employees are in different tables, I
could not set up an index, so I was using a Dupe Record query. I am
trying to run the query after entering each employee automatically as
soon as the subform employee field is updated.)
Here's the SQL for qryEventEmpDupes:
SELECT qryEventEmp.EmployeeIDpk, qryEventEmp.Event,
qryEventEmp.EventDate
FROM qryEventEmp
WHERE (((qryEventEmp.EmployeeIDpk) In (SELECT [EmployeeIDpk] FROM
[qryEventEmp] As Tmp GROUP BY [EmployeeIDpk],[Event] HAVING Count(*)
Here's the code that doesn't seem to be doing anything:
Private Sub EmployeeIDfk_AfterUpdate()
If DCount("*", "qryEventEmpDupes") > 0 Then
MsgBox "Duplicate Records Found!"
Cancel = True
End If
End Sub
I appreciate any help!
VR/Lost
I put this into the AfterUpdate event of the EmployeeIDfk combobox on
the continuous subform.
(I have Date and Event on the mainform, and then select Employees on
the subform. Since Event and Employees are in different tables, I
could not set up an index, so I was using a Dupe Record query. I am
trying to run the query after entering each employee automatically as
soon as the subform employee field is updated.)
Here's the SQL for qryEventEmpDupes:
SELECT qryEventEmp.EmployeeIDpk, qryEventEmp.Event,
qryEventEmp.EventDate
FROM qryEventEmp
WHERE (((qryEventEmp.EmployeeIDpk) In (SELECT [EmployeeIDpk] FROM
[qryEventEmp] As Tmp GROUP BY [EmployeeIDpk],[Event] HAVING Count(*)
ORDER BY qryEventEmp.EmployeeIDpk, qryEventEmp.Event;1 And [Event] = [qryEventEmp].[Event])))
Here's the code that doesn't seem to be doing anything:
Private Sub EmployeeIDfk_AfterUpdate()
If DCount("*", "qryEventEmpDupes") > 0 Then
MsgBox "Duplicate Records Found!"
Cancel = True
End If
End Sub
I appreciate any help!
VR/Lost