I have a database with a large number of records. There are a couple of
queries that take a while and I was wondering whether I could create a
progress bar like that used for installing software so that the user
knows something is happening and when it finishes. Thanks
Tony
I don't think so. A progress bar implies multiple processes performed in
sequence and it "progresses" as each individual process completes. To
your Access app the running of a query (regardless of how long it takes)
is a single process.
Your progress bar would sit at zero until the query was finished and then
it would jump to 100% all at once when it finished. The query does not
expose to your code anything to indicate how far along it is.
Ever notice how progress bars for installing software often do the same
thing? They tick along for a while and then pause for a protracted
period only to jump a whole bunch. Same principle. While it is
measuring multiple steps, some of the steps represent a small piece of
the total and some represent big chunks of the total. Your long running
query is one big chunk that represents 100% of the progress you are
trying to show the user.
As an aside, what specifically are you describing as "a large number of
records" and "queries that take a while"? I consider (almost) all
queries that takes longer than 10 seconds to be a problem of design. You
might post your structures and your query SQL and get some tips on how to
make them run faster.