Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2004, 07:40 AM
Ben Ben is offline
Authorized User
 
Join Date: Jun 2003
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?
 
Old January 28th, 2004, 02:02 PM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old January 28th, 2004, 03:24 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or you can link to the data instead.



Sal
 
Old January 29th, 2004, 08:50 AM
Ben Ben is offline
Authorized User
 
Join Date: Jun 2003
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.





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.