Is there I way that I can setup a notification alarm in Access? I am doing a database for storing staff contracts and I have a field for "contract end date" and I want to set something up so that I am notified by a dialog box when the length of the agreement is 6 months from expiring.
I have the following bit of code which picks up the correct number of records, but the persons name does not change. Can anyone help please?
thanks
Dim dbs As Database, rst As Recordset
Dim strSQL As String
Set dbs = CurrentDb
'strSQL = "SELECT * FROM Main WHERE (((Main.[Termination Date]) <= (Date() + 180)))"
strSQL = "SELECT Main.[Presenter Name], Main.[Termination Date]FROM Main WHERE (((Main.[Termination Date])<=(Date()+180)))"
Set rst = dbs.OpenRecordset(strSQL)
While Not rst.EOF
MsgBox ("The contract of presenter " & [Presenter Name] & " is due to expire in approximately 6 months time.")
DoCmd.Requery
'Debug.Print rst.RecordCount
rst.MoveNext
Wend
rst.Close
Set dbs = Nothing
I have the following bit of code which picks up the correct number of records, but the persons name does not change. Can anyone help please?
thanks
Dim dbs As Database, rst As Recordset
Dim strSQL As String
Set dbs = CurrentDb
'strSQL = "SELECT * FROM Main WHERE (((Main.[Termination Date]) <= (Date() + 180)))"
strSQL = "SELECT Main.[Presenter Name], Main.[Termination Date]FROM Main WHERE (((Main.[Termination Date])<=(Date()+180)))"
Set rst = dbs.OpenRecordset(strSQL)
While Not rst.EOF
MsgBox ("The contract of presenter " & [Presenter Name] & " is due to expire in approximately 6 months time.")
DoCmd.Requery
'Debug.Print rst.RecordCount
rst.MoveNext
Wend
rst.Close
Set dbs = Nothing