Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 28th, 2004, 07:40 AM
Ben Ben is offline
Authorized User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automate Queries

I have a few queries that pull data from a couple of ODBC sources. Currently I go into the database and use a command button to run the process to bring the data upto date. Is there a way I can automate this to run daily?
The database sits on the network, but I potentially could have a workstation permanently logged in... ...what can I use to trigger the code by time of day?
Reply With Quote
  #2 (permalink)  
Old January 28th, 2004, 02:02 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Ben, you can create a form that has a Timer event. Set the form's Timer Inverval to check once per hour, for example. When the desired time of day occurs, use the DoCmd.RunSQL code to run the queries. To turn your queries into SQL code just open them up in design view and click VIEW > SQL VIEW to get the statement.

Have a flag, say, fDone set false and when the SQL is run, set it to true so that the queries don't run for the rest of the day. Then at midnight, set the flag back to false.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old January 28th, 2004, 03:24 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or you can link to the data instead.



Sal
Reply With Quote
  #4 (permalink)  
Old January 29th, 2004, 08:50 AM
Ben Ben is offline
Authorized User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Linking to the source wasn't an option as the data is transient. I've utilised Task Scheduler and have scheduled a seperate DB with an autoexec to execute the passthrough queries and the main db now links to the data in this.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
automate the fields anukagni Access 3 February 12th, 2007 08:45 AM
Combining Queries or results from 2 queries Ford SQL Server 2000 24 November 7th, 2005 08:54 PM
How to automate import with notepad timoma Access 20 February 11th, 2005 03:03 PM
Automate Export roniestein Access 13 October 16th, 2003 04:05 PM



All times are GMT -4. The time now is 04:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.