Scheduled Report Creation

Gwill1983

Board Regular
Joined
Oct 24, 2018
Messages
123
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am fairly new to access and trying to establish whether there is a way to schedule a report within my db to create and save to a file location every Friday at 9am?

I have tried to investigate through power automate, but seems like the link is a premium function which isnt something that I currently have.

Is anybody able to give me a little guidance to see if this is a possibility before I look for alternatives?
Thanks
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I am going to assume you know how to make a macro in Access that creates and saves a report.

What you can then do, is use Windows Taskscheduler to create a scheduled task.

To make Windows Taskscheduler work, you first need to create a VBS script.
To do so, open the notepad, and type the following code:

VBA Code:
Dim accessApp
set accessApp = createObject("Access.Application")
accessApp.visible = true
accessApp.UserControl = true

accessApp.OpenCurrentDataBase("C:\foldername\yourdatabasename.accdb")
accessApp.DoCmd.RunMacro "Macroname"
accessApp.application.quit

Save the file as a TXT file, and close it.
Now, rename the extension of the TXT file to VBS.
If you now double click on the VBS, it will open a session of Access, open database "yourdatabasename.accdb" and run the macro named "Macroname".
If this works as expected, then you can open the windows Taskscheduler.

Inside the Taskscheduler, create a new task. From there you can follow the steps the taskscheduler guides you through.
 
Upvote 0
If your org won't allow you to save & call such script files, have TS run a shortcut. That shortcut can use a command line switch called cmd. When db opens, code can check if the command property of the db exists. If so, it is TS who has opened. If not, it is a regular user. You can test with something like
If Trim(Command) = "" Then <-- regular user, or at least one who knows better than to use said shortcut if they can even see it.
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,212
Members
448,874
Latest member
b1step2far

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top