I have a scheduling form that may retain the record for a while until it is entered into the check registry. What is someone uses the check number assigned to the event when it was entered? I have a query to check for such a thing but wonder how I could run this before the event is entered and warnings and stop the event, etc...
Since the query adds a where statement, I dont know how to address this as code. I have other code that will run If this and that and a append query as well, but dont want this to run if the check is a duplicate and if it is, then user corrects and rechecks. How can I put this as vba or what else can I do?
This is the code from the dup check query.
SELECT TReg.ChkNo, TReg.Bank
FROM TReg
WHERE (((TReg.ChkNo) In (SELECT [ChkNo] FROM [TReg] As Tmp GROUP BY [ChkNo] HAVING Count(*)>1 )))
ORDER BY TReg.ChkNo;