run query, form, report from 'outside' db

barbarossaii

Master of Disaster
Local time
Today, 19:27
Joined
Dec 28, 2002
Messages
70
Hi,

I wonder if there is a way to run a query, a form or a report from the 'outside' of the db via a special command (in a batch etc.).


Thanks in advance for your help,

Barbarossa II
 
Hey babar,

Tell me a little bit more about where you are running these actions from?

I mean, do you want to run a query from another database while you are still in Access, or are you using Excel? VB? Do tell...


Big Jim
 
Hi BigJimSlade,

the db needs to be updated each night only. And I got a query which is way too slow. So I thought about creating make-table querys that update some data and put the results of the slow query into a table; a query based on the created table is faster than the original one.

That is why I'd like to know if it is possible to run the query from outside: I'd like to create a small 'programm' (batch-file or whatever) which runs the make-table queries at night. In the 'programm' there must be a command that tells the computer to run the queries ( like "call query_A in db_X" or "run [query_Y] .db_Q" ).

Which possibilities exist to solve the problem?


Thanks in advance for your help,

Barbarossa II
 
Hey Barbar,
I think I am getting closer to understanding what you want. You are looking to run some queries at a specific time. Well, I think the best way to do this in Access by itself is to use the Timer Function on a Form's Properties.


Create a new form to work with.

At the bottom of Form Properties under Events (Not on Detail, but on Form, make sure you actually click on the form and not the box you can put objects into, the space behind the box you place your labels and objects I mean), you will see the On Timer Function and Timer Interval.

Timer Interval determines in milliseconds how often the computer runs the code in the On Timer Function.

In the On Timer Function, you just have to place code that is set to run after a specific time. If that time of day has not been reached, the code ends and Access continues to Loop through the Timer Interval. Make sure you code the Timer Function to run only once though.

If you need some code to help you along with this (assuming you like this idea), let me know, and I will help write some for you. This way, you can run all of these queries that you want to from your Access database without having to create your batch file outside of Access you were interested in.

If anyone else has better ideas, help us out here. But I know my idea will work, cause I do it all the time. :)

Let me know if you need some code!

Big Jim
 
That works, Thanx !

Hi Big Jim,


Jiiiiipi, that works. Its better than using some 'command' to start a macro/report/query because the timer is 'built in' the form already !

Thank you !


Barbarossa II
 

Users who are viewing this thread

Back
Top Bottom