Hi,
As a relative Newbie, I'd appreciate a little assistance with an A2003
DB I'm trying to enhance.
This DB handles reports made by security staff on a shift by shift
basis based on two shifts per day. The two relevant fields are called
Datum and Shift.
I want to trigger an alert whenever the user tries to create a new
report when a report for that Datum / Shift combination already
exists. Ideally the alert would be triggered in the After Update Event
in the Shift. If the alert wasn't triggered then another form would
open so allowing the user to create a new report.
I have made a query called qryAlertExisting which produces distinct
Datum/Shift results and I wanted to use this with a bit of code I've
taken from another of my DB's which triggers an alert but is based on
searching one field only. What I want now is to modify this code to
consider two fields (Datum & Shift) and to flag up if the proposed new
combination already exists.
The code is :-
If DCount("Datum","QryAlertExisting")<1 Then
DoCmd.OpenForm "FrmAddNewReport"
Else
MsgBox "A report already exists for that Shift on that Date""
End if
Many thanks,
Yvonne