I need to check if a record has been entered into a table from my form using the OnCurrentEvent.(Really, I am looking to see if a check number has already been entered into the table TReg) My Form name is frmEvent and the field I am looking for is named ChkNo which is on my form. I want to see if that number is on another form FReg. Table (frmEvent) is using is tblEvent and field name is ChkNo and table to compare to is TReg and field is ChkNo on form FReg.
Since I am using a scheduler and it resets the date entered, I have no way of knowing if the event has already been entered unless it happens to be on that day!
Example: I enter a scheduled event and post it to check register and the next day comes around, the form will not show if the event has been posted or not since the event date has expired. I have to go and manually see if the event is in the table/form.
One more thing.Here is the sql code for check dupes but how can I use this on my form? I need this as vba so I can set criteria!
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;