?
Solved

Running a subroutine automatically

Posted on 2007-11-26
3
Medium Priority
?
698 Views
Last Modified: 2013-11-27
I am using MS Access 2003.

I have a subroutine that will import a .csv file and append it to a master table. I would like this subroutine to run at a set time each morning with no intervention.

Is this possible?
0
Comment
Question by:TylerDerden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Expert Comment

by:JimFive
ID: 20352617
Create a macro that has two steps:
1.  run your code and
2. exit the database.

In the "control panel" Add a "Scheduled Task"

The Task should be a command line that looks something like:

"C:\Program Files\Microsoft Office\MSACCESS.EXE" "Path\to\access.mdb file" /x MacroName

--
JimFive
0
 

Author Comment

by:TylerDerden
ID: 20353567
Thnx JimFive. I think we may be close.

I'm running on Windows XP Enterprise.
When I get to the schedule a task dialog box the fields to enter are:
Run:
Start in:

For the run option I clicked browse and selected to access database. However, I do not see a place where I can specify with vba module I would like to run.
Also, I do not know what to enter in for start in.

I googled it but the ms site wasn't very helpful.

Any ideas?
0
 
LVL 15

Accepted Solution

by:
JimFive earned 750 total points
ID: 20354889
In the run box, don't select the access database.  You need to have the full command line:

"C:\Program Files\Microsoft Office\MSACCESS.EXE" "Path\to\access.mdb file" /x MacroName


Your MSACCESS.EXE may be in a slightly different location.  your Macro Name goes where I typed MacroName and your access database full path goes where I typed "Path\to\access.mdb"

For start in use the directory where the access.mdb is located.

--
JimFive
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question