I've got a form which holds data for employees, fname, lname, ..... and an entered date which defaults to now().
On the before update event, i have the following.
With the above vba code, a msgbox pops up if the record combination already exists. What I would like to do is in the same msgbox have the "entered" date display and make the msgbox say something like.
This record already exists and was entered on 6/18/2015, [entered]
Any help is appreciated.
Respectfully,
David
On the before update event, i have the following.
Code:
If DCount("*", "trainingdata", "[Empid]=" & Me!EmpID & _
" And [subjectid]=" & Me!SubjectID & _
" And [trainingdate]=#" & Me!TrainingDate & "#") > 0 Then
MsgBox ("This record already exists")
Cancel = True
Me.Undo
Me.SubjectID.SetFocus
End If
End Sub
This record already exists and was entered on 6/18/2015, [entered]
Any help is appreciated.
Respectfully,
David
Last edited by a moderator: