Dan Thomas
Dan Thomas

Reputation: 285

Improve Speed of Sub-Form

I have a form that has been getting slower as time goes on. At first to navigate between records took no time at all. After awhile it took a second. Then awhile later it took two seconds when switching records. Now I am at three seconds when switching records.

Here are the details:

The user gets prompted with a form that has some options to choose from. Based on those options the main form pops up showing only related records. The main form links to a query that was generated by the users selections. On the main form is sub form that links directly to another table (QuoteRunResults). The table right now contains 354,000 records. The form that is slow is the sub form.

Here is a sample query that may be used:

SELECT * 
FROM QUOTERun
WHERE QuoteNumber = {UserSelectedQN}
ORDER BY RunID DESC

Is there anyway I can speed up the sub form?

Upvotes: 2

Views: 2385

Answers (1)

Tommy Johnson
Tommy Johnson

Reputation: 239

I have experienced this type of situation before. What I did to completely remove the lag was the following:

  • Use a query to generate the two data sets needed for both forms.
  • Programically create a temporary table for each data set and populate it from the results of the query
  • Link the forms to the temporary tables
  • Allow the user to do whatever they need to do to the data
  • Once the form is closed programically update the real data from the temporary tables
  • Delete the temporary tables

This actually made the forms fly. I had no more problems with lag. When I clicked on the button to move to the next record it happened immediately. In my situation I had a lot going on in the On Current event that slowed the form down. Once I applied the above it sped right up.

Upvotes: 2

Related Questions