Automatically send weekly email with report (1 Viewer)

azlan

Registered User.
Local time
Today, 05:06
Joined
Aug 14, 2014
Messages
39
Hi there,
I have a similar project
and I am not very good at coding, If you don't mind can you share template of your access file please....
 

MrHans

Registered User
Local time
Today, 14:06
Joined
Jul 27, 2015
Messages
147
Hi Guys,

Based on this idea, I am building a similar function.
Instead of sending a report weekly, I would like to do it only once per month.

I am now building the check to see if the report from this month was sent already or not.

Code:
If DCount("*", "tblKpiReporting", "#" & Format([ReportDate], "mm\/yyyy") & "# = #" & Format(Now, "mm\/yyyy") & "#") > 0 Then

The ReportDate field is a Date/Time field and will be filled with Now through an SQL Insert statement whenever the report is sent.

My code keeps giving Error 13: Types don't match.

Any idea's?
 

MrHans

Registered User
Local time
Today, 14:06
Joined
Jul 27, 2015
Messages
147
Ok, after many failed attempts, I found another solution to my problem:

Code:
DCount("*", "tblKpiReporting", "Month([ReportDate]) = " & Month(Date()) & " And Year([ReportDate]) = " & Year(Date))

This is working fine for me.
 

Users who are viewing this thread

Top Bottom