Solved

Running a subroutine automatically

Posted on 2007-11-26
3
695 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 250 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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