possible to run two query together?

kitaeshi

Registered User.
Local time
Today, 16:01
Joined
Jun 9, 2007
Messages
30
hi all is it possible to run both query at a time on a form?
example i click the button, first query run then goes to second query
 
But with a little bit of VBA you can run them sequentially from a single button click.

Here's how. Use the button wizard to build the button on the form. Have it run your first query. Now go back to the form in design mode and look at the code. You will see how the first query is run. Before the button-click code exits, duplicate the part that runs the first query but give it the name of the second query.

As long as there are no circular logical relationships between the two tables, you should be OK. The only problem would be if the something in the first query depended on having already run the second query AND something in the second query depended on having already run the first query. If the results of the queries are independet, you are good to go and it will be transparent.

At least in theory, the only way to make two queries run at once is if you have a dual core CPU and understand thread programming. If these terms are alien to you, then Bob's answer is correct. I expressly do not recommend attempting this even as a dual query with parallel threads if it happens that both queries use the same function. That is because some of the Access intrinsic functions aren't re-entrant. (Don't normally need to be.) The code that YOU write underlying anything with VBA is probably not reentrant, either. Without re-entrancy, parallel code is going to give you strange, exotic, and just plain wrong answers.
 

Users who are viewing this thread

Back
Top Bottom