VBA & Macro Problems

Automatically Email a Microsoft Access Report at a Scheduled Time

Khadija KhanKhadija Khan Nov 13, 2026 868 views

Question details

The user needs to generate and email a Microsoft Access report automatically at the end of each day.

Automatically Email a Microsoft Access Report at a Scheduled Time
Product
Microsoft Access
Device & OS
not provided
Scenario
Run a daily report and send it by email at a scheduled time without manually selecting Send.
Observed behavior
The desired result is a scheduled report email that does not require opening and sending a message manually.
Before you start

Confirm that the report opens correctly in Access and that a compatible desktop email client is configured for the Windows account that will run the task. Note the database path, report name, recipient address, and installed MSACCESS.EXE path before configuring the schedule.

Solution 1Recommended

Schedule an Access macro that emails the report with VBA SendObject

Use an Access macro to call a VBA function, then launch that macro daily through Windows Task Scheduler.

The Access /x command-line switch runs a named Access macro, not a VBA procedure directly. Create a macro with a RunCode action to bridge the scheduled launch to your VBA function.

SendObject uses a compatible email client. Setting EditMessage to False skips the message-editing window, but email-client security prompts or account dialogs can still prevent unattended delivery.

1
Create the email function

Open the database in Access, press Alt+F11, and select Insert > Module. Add this function, replacing DailyReport and recipient@example.com with your report name and recipient: Public Function EmailDailyReport() As Boolean DoCmd.SendObject ObjectType:=acSendReport, ObjectName:="DailyReport", OutputFormat:=acFormatPDF, To:="recipient@example.com", Subject:="Daily report", MessageText:="Attached is today's report.", EditMessage:=False EmailDailyReport = True End Function Save the module as modDailyEmail. Do not give the module the same name as the function.

2
Create the launch macro

Return to Access and select Create > Macro. Add a RunCode action and enter EmailDailyReport() in Function Name. Add QuitAccess after RunCode if this scheduled Access session should close when the function finishes. Save the macro as SendDailyReport.

3
Test sending under the scheduled account

Double-click SendDailyReport in the Access Navigation Pane while signed in to the Windows account that will run the task. Confirm that the intended report PDF arrives without requesting report parameters, message editing, or email-client approval. If Access blocks the code, use a trusted location for this database only if you trust its contents.

4
Configure the daily task

Open Windows Task Scheduler and select Create Task. On General, select the intended Windows account and Run only when user is logged on for this desktop-email-client approach. On Triggers, select New, choose a Daily schedule, and set the end-of-day time. On Actions, select New > Start a program. Set Program/script to the full MSACCESS.EXE path. Set Add arguments to "C:\Reports\DailyReports.accdb" /x SendDailyReport, replacing the database path with your own.

5
Validate the scheduled run

In Task Scheduler, right-click the task and select Run. Check the recipient's inbox, the task's History if enabled, and Last Run Result. In the task's Conditions and Settings tabs, review power and missed-start options, and prevent overlapping runs. Keep the computer available and the configured user signed in at the scheduled time.

Schedule an Access macro that emails the report with VBA SendObject
Unattended delivery has limits: A successful task launch does not prove that the email was delivered. If sending must work while no user is signed in, use an approved server-side email service or API with report export and delivery logging rather than relying on desktop SendObject automation.
Free Microsoft Office alternative

Use WPS Office to Work with Exported Access Reports

WPS Office is a free, lightweight, easy-to-use alternative for everyday document work. Its familiar interface and Microsoft Office format compatibility make migration straightforward for exported report documents and spreadsheets. It does not run Access databases, Access macros, or scheduled SendObject emails.

View report PDFs exported from Microsoft Access.Work with Microsoft Office formats including DOCX, XLSX, and PPTX.Use familiar document and spreadsheet tools with a lightweight Office suite.Move exported report files into WPS workflows without rebuilding the Access database.
microsoft office alternative - wps office

Frequently Asked Questions

Can the /x switch run my VBA function directly?

No. The Access /x switch runs a named Access macro. Select Create > Macro, add RunCode with EmailDailyReport() as the Function Name, and save it as SendDailyReport. Then launch Access with the database path followed by /x SendDailyReport.

Why does Access still ask for approval before sending?

EditMessage:=False prevents the email-editing window from opening, but it does not bypass email-client security controls. Run the macro manually under the scheduled Windows account to identify the prompt. Use an approved email integration if security prompts prevent reliable automation.

Will the task work if I am signed out of Windows?

Do not rely on desktop SendObject automation in a signed-out session. For this approach, open Task Scheduler > task Properties > General and choose Run only when user is logged on. For delivery without an interactive session, use a server-side email service or API.

How do I prevent the report from asking for a date before it sends?

Open the report's underlying query in Design View and replace interactive parameter prompts with date criteria or values supplied by your automation. For example, Date() can represent the current date. Test the report from the Navigation Pane to confirm that it opens without requiring input.

Can WPS Office replace Access for this scheduled email task?

No. WPS Office does not execute Access databases or Access VBA macros. Use Microsoft Access for the report automation; WPS Office can help you view exported PDFs and work with exported Office-format documents and spreadsheets.