Janice,
The queries you are building are NOT "passthrough" queries, so if you are accessing a remote server and processing a lot of records, be aware that ALL processing will be happenning on your PC and travelling over the network. This can really block things up.
Can you identify the type of server that is at the other end of your query. The idea of "passthrough" queries, is that you get the database server to do all of the work resolving the query, and then send only its results back to the client. In order to do this, you use the "passthrough" query type.
To define a passthrough query, do the following:
(a) In Query design view, create a new query with no tables.
(b) From the menu, select Query, SQL Specific, PassThrough options from the menu.
(c) Type appropriate SQL (for the target server) into the query window.
(d) Select the View, Properties options and set the queries ODBCTimeOut property to zero.
When you need to run the query, use the following command
docmd.openquery "qryYourQueryName"
There's actually a lot more you can do programmatically, but hopefully this has given you a bit of a flavour.
Cheers,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au