Hi, John.
your code is alomost exactly what I have
and it works but slow.
Do you have an index on the field that is being used as the criteria for the
WHERE clause? That can speed things up immensely, especially when the data
set is being retrieved from a back end file across the network. Are other
processes using this table using optimistic locking? Optimistic locking
retrieves records faster for the user than pessimistic locking does. Are all
processes using this table using record-level locking or page level locking?
Record-level locking retrieves records faster for the user than page level
locking does.
If this is a split database, is there a persistent connection to the back
end? Preventing the user from establishing a new connection to the database
and creating a new .LDB file every time the tables are queried can save lots
of time. If this is a split databse, is the back end file as close to the
root directory as possible? Every directory traversed requires Windows to
use the Windows Networking API to check whether the user has Windows security
permissions to access that directory. Lots of directories in the path means
the Windows Networking API gets called lots of times. Does the file name and
the complete path to it use the old DOS 8.3 naming convention or the Windows
long name convention? Again, the Windows API for resolving long names must
be called to resolve the path and file name if the DOS 5.3 naming convention
isn't adhered to. It takes time for all of these things to happen,
especially on a network with lots of traffic.
Can I use the 20-30 records from the
1st form in the 2nd form and use the WHERE clause on it? So set the 2nd foms
record source to be the 1st forms recordset?
Unfortunately, no. The second form is a separate entity and must query the
database itself when it opens. The second form can't "share" the same
Recordset Object as the first form, but it can retrieve the exact same
records from the database.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.