Set the Timer interval of the form to 10,000 (10 seconds) or whatever
& Put the following code into the 'On Timer' event.
DoCmd.Requery
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("TableName", dbOpenDynaset)
rs.MoveLast
If vTableRecordCount <> rs.RecordCount Then
vTableRecordCount = rs.RecordCount
MsgBox "New Record Added"
End If
rs.Close
db.Close
Every 10 secs the form will check the Table to see if the record count has changed and throw up the mssg. (p.s. the mssg appears if any records are deleted as well, which for me, works OK)
I did insert my own table name in the line. I struggeld with the "dim db as database" line to but i did not have the right references selected. So after selecting the sql references that came right.
I did insert my own table name in the line. It looks like vb don't reconize the OpenRecordset as a valid command or something. When I try to run the code it highlits that specific line. After you type db. vb gives you a drop down list with commands and the OpenRecordset command is not available.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.