Question : How to freeze data without affecting other users

I have a VBA procedure that takes a few minutes to run because it calls several action queries. During this procedure, some tables are accessed more than once. For correct results the data that the procedure sees from these tables must stay constant until the procedure finishes.
How do I ensure that the data (as seen by the procedure) can't be affected by other users?
I would prefer not to lock other users out of these tables, and I would prefer not to make temporary copies of these tables. I'm not sure if transactions and separate workspaces would help.

Answer : How to freeze data without affecting other users

Milewskp said:
>>I would prefer not to lock other users out of these tables, and I would prefer not to make temporary copies of these tables

Out of curiosity, why not?  I do that frequently, and have often found it to be indispensible.

For example, if I have a report that requires lots of complicated calculations/business logic, I will set up the queries/
code that stage that report to write the data to temp tables *in the front end* file.  That way, two users can run the
same reports at the same time without interfering with each other.

It also makes troubleshooting *much* easier: since the temp tables store the intermediate results, I can check
each stage of the calculation to make sure things are processing correctly.

I then include an event sub on the closing of my switchboard to clean up my temp tables, and have the FE file
set to compact on close.  Very tidy, very useful.
Random Solutions  
 
programming4us programming4us