craigprice
Registered User.
- Local time
- Today, 13:45
- Joined
- Apr 8, 2013
- Messages
- 44
Hi,
I have created a form with "notifications" I am wanting to create a table which contains different types of notifications that will automate (some are manually input too)
I have tried this with the following but it seems to just hang when the form runs.
Basically I want it to look at all records on the current form/table and if the time is the present time then it will add the relevant record to the table.
So far I tried this:
I managed to get it to run for the first record and it successfully adds it when the relevant time is reached however I want it to continually check all records.
I'd like the time to issue to be taken from a table as I plan on giving admins the ability to add additional scheduled notifications to this.
Example of the table the "templates" are pulled from
ID time day title message
8 21:22:40 Monday TIMESHEETS AUTOMATION TEST
I have created a form with "notifications" I am wanting to create a table which contains different types of notifications that will automate (some are manually input too)
I have tried this with the following but it seems to just hang when the form runs.
Basically I want it to look at all records on the current form/table and if the time is the present time then it will add the relevant record to the table.
So far I tried this:
Code:
Private Sub Form_Timer()
[CLOCK].[Requery]
Me.Requery
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = Access.CurrentDb
Set rs = db.OpenRecordset("updates")
With rs
Do Until .EOF
If Me.Time = Me.CLOCK Then
rs.AddNew
rs!Title = "" & [Title]
rs!Message = "" & [Message]
rs!author = "OCP-AUTOMATION"
rs.Update
ElseIf Me.Dirty = False Then
.MoveFirst
End If
Loop
End With
End Sub
I'd like the time to issue to be taken from a table as I plan on giving admins the ability to add additional scheduled notifications to this.
Example of the table the "templates" are pulled from
ID time day title message
8 21:22:40 Monday TIMESHEETS AUTOMATION TEST
Last edited: