Question

I am tasked to fix a performance issue on a Microsoft Access Form. The page has a datasource using a Query. The Query joins several tables and does summation. The problem is when the page loads, the form uses a dummy value like QueryColumn = 'ImplossibleValue' to show an empty.list. The form contains search condition filter plus search button. When the search button is click the correct Filter is set.

Because the query handles a lot of data, the page loads very slow at first but when the form opens the user is presented with blank query as design. Is there a way to Open the form and to make it have no data source?

Was it helpful?

Solution

You can change the recordsource to a query which returns Null values and need not reference any of your tables.

SELECT Null AS field1, Null AS field2;

After the user selects her search criteria, change the recordsource to the query which incorporates those criteria. Changing the recordsource automatically triggers a requery.

If a user saves the form design after the recordsource has been changed to the search query, the form will use that again the next time it is opened. You can force the form to always open with the dummy row query as its recordsource by resetting that property during the form open event.

Me.RecordSource = "SELECT Null AS field1, Null AS field2;"

OTHER TIPS

When you open the form, use a where condition in the docmd.openform statement. where primarykey = null there will be no records and you don't need to unbind the entire form.

I had similar performance problems with Jet 10 years ago, and the only resolution I found was to move to Access Data Projects.

Upsize to client-server application using SQL Server, run a couple of query wizards to determine proper indexing, and you'll have excellent performance in no time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top