Question Send Message alert on the next day if current day is vacation (1 Viewer)

Jovial

Registered User.
Local time
Today, 02:17
Joined
Jan 21, 2015
Messages
29
Hello All,
My requirements is to send the alert messages with the approaching due date on every Monday of the week. I am able to send alert messages on Monday. My Problem is: How to send alert messages on Tuesday if Monday is Vacation. Is there a way to do it in access? I don't have much experience in access. Please help me.
 

pr2-eugin

Super Moderator
Local time
Today, 10:17
Joined
Nov 30, 2011
Messages
8,494
Hello Jovial. Welcome to AWF :)

You need a table which records the vacation dates, and that will be cross checked when alerting.
 

Jovial

Registered User.
Local time
Today, 02:17
Joined
Jan 21, 2015
Messages
29
Thanks Paul For your Quick reply!
I have another problem too :)
I have written VBA(Listed below) to send an attachment to an email. Problem is email does not send out. It sits in email as a draft. I am using lotus notes for the email. Appreciate your help!!!
VBA
Private Sub Form_Open(Cancel As Integer)
If Weekday(Date) = 5 Then
Dim rs As DAO.Recordset
Dim strSQL As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("SELECT EAddress FROM temailTable")
With rs
Do While Not rs.EOF
DoCmd.SendObject acSendTable, "tableName", acFormatXLS, rs![EAddress], , , " Subject", "Hello," & Chr(10) & Chr(13) & "Please find the attached document" & Chr(10) & Chr(13) & "Thank you" & Chr(10) & Chr(13) & "Database" & Chr(10) & Chr(13) & "Date:" & Date, False
rs.MoveNext
Loop
rs.Close
End With
Set rs = Nothing
Set db = Nothing
End If
End Sub
 

Jovial

Registered User.
Local time
Today, 02:17
Joined
Jan 21, 2015
Messages
29
No Response!!!
Please somebody response to it.
Thanks
 

BlueIshDan

☠
Local time
Today, 06:17
Joined
May 15, 2014
Messages
1,122
Place your code in code braces please. It's not very inviting to read which leads to it not being very inviting to help you! lol
 

Jovial

Registered User.
Local time
Today, 02:17
Joined
Jan 21, 2015
Messages
29
Not a good Programmer :)
But still tried to make it more readable

Private Sub Form_Open(Cancel As Integer)
// Check if today's date is thursday
If Weekday(Date) = 5 Then
{
Dim rs As DAO.Recordset
Dim strSQL As String
Set db = CurrentDb()
// Select email address from the table
Set rs = db.OpenRecordset("SELECT EAddress FROM temailTable")
With rs
Do While Not rs.EOF
// Attach table in email
DoCmd.SendObject acSendTable, "tableName", acFormatXLS, rs![EAddress], , , " Subject", "Hello," & Chr(10) & Chr(13) & "Please find the attached document" & Chr(10) & Chr(13) & "Thank you" & Chr(10) & Chr(13) & "Database" & Chr(10) & Chr(13) & "Date:" & Date, False
rs.MoveNext
Loop
rs.Close
End With
Set rs = Nothing
Set db = Nothing
}
End If
End Sub
End Sub
 

BlueIshDan

☠
Local time
Today, 06:17
Joined
May 15, 2014
Messages
1,122
Go in advanced mode and place them in

[ CODE ] code here [/ CODE]

Remove the spaces. You WILL LEARN! :D lol
 

Users who are viewing this thread

Top Bottom