Hi
i have a code that pings a user through net send but I need this to happen at a specific point during the day. at 16:00.
The coding is below:
Function ping()
Dim netmessage1
Dim recipient1
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim StrSql As String
StrSql = "SELECT WeekLog.[Employee Number]as emp,
Shift_Patterns.ShiftLevel, Shift_Patterns.Moday FROM
Shift_Patterns INNER JOIN WeekLog ON (WeekLog.ShiftLevel =
Shift_Patterns.ShiftLevel) AND (Shift_Patterns.
[ShiftPattern ID] = WeekLog.[ShiftPattern ID]) AND
(Shift_Patterns.[ShiftPattern ID] = WeekLog.[ShiftPattern
ID])WHERE (((Shift_Patterns.Moday)='10:00-6:00'));"
Set db = CurrentDb
Set rst = db.OpenRecordset(StrSql, dbOpenSnapshot)
If rst.BOF And rst.EOF Then
Call MsgBox("No Team Members meet the criteria."
Else
Do Until rst.EOF
netmessage1 = "The TeamMember on the 8:00-4:00 Shift has
now left please now take over the Odin support Mail basket"
Shell ("net send " & rst("emp"
& " " & netmessage1 & ""
rst.MoveNext
Loop
End If
rst.close
Set rst = Nothing
db.close
Set db = Nothing
netmessage1 = "The TeamMember on the 8:00-4:00 Shift has
now left please now take over the Odin support Mail basket"
Shell ("net send " & recipient1 & " " & netmessage1 & ""
End Function
So What can I include in this to make it execute at a
certain time.
I have been experimenting with loops and time() = 16:00 but
cannot get it to work
Many Thanks
tim
i have a code that pings a user through net send but I need this to happen at a specific point during the day. at 16:00.
The coding is below:
Function ping()
Dim netmessage1
Dim recipient1
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim StrSql As String
StrSql = "SELECT WeekLog.[Employee Number]as emp,
Shift_Patterns.ShiftLevel, Shift_Patterns.Moday FROM
Shift_Patterns INNER JOIN WeekLog ON (WeekLog.ShiftLevel =
Shift_Patterns.ShiftLevel) AND (Shift_Patterns.
[ShiftPattern ID] = WeekLog.[ShiftPattern ID]) AND
(Shift_Patterns.[ShiftPattern ID] = WeekLog.[ShiftPattern
ID])WHERE (((Shift_Patterns.Moday)='10:00-6:00'));"
Set db = CurrentDb
Set rst = db.OpenRecordset(StrSql, dbOpenSnapshot)
If rst.BOF And rst.EOF Then
Call MsgBox("No Team Members meet the criteria."
Else
Do Until rst.EOF
netmessage1 = "The TeamMember on the 8:00-4:00 Shift has
now left please now take over the Odin support Mail basket"
Shell ("net send " & rst("emp"
rst.MoveNext
Loop
End If
rst.close
Set rst = Nothing
db.close
Set db = Nothing
netmessage1 = "The TeamMember on the 8:00-4:00 Shift has
now left please now take over the Odin support Mail basket"
Shell ("net send " & recipient1 & " " & netmessage1 & ""
End Function
So What can I include in this to make it execute at a
certain time.
I have been experimenting with loops and time() = 16:00 but
cannot get it to work
Many Thanks
tim