Improving Query Performance

CPGDeveloper

Board Regular
Joined
Oct 8, 2008
Messages
174
Hi All ~

I administer an Access based application -- and since moving our back end to Azure SQL, our initial front end form is taking about 30 seconds to load. It took about 5-10 seconds when using a split MS Access Back End.

The Control Source of the subform that loads upon open changes depending on who is using the application. I have code that determines who is using the application, and based on who that is, generates a different sql statement to populate the control source. I then change the control source of the subform, and requery. I'm wondering if there's a simpler, faster way to achieve this --

When stepping through the code, where it slows down are these two statements --

Forms!fMain.subformMain.Form.RecordSource = mysql 'mysql is a sql statement that i've previously defined. It runs in one second when I run it directly as a query
Forms!fMain.subformMain.Requery

Both of these code lines take about 10-15 seconds each to generate. Everything else appears to be instant. Is there another way to write this. This is executed on the Form Load Event of the Primary Form.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
If you change the record source of a form, that in itself is a requery, so no use repeating it, especially if the dataset is large?

If it is one used a lot, perhaps try using it as a saved query?

HTH
 
Upvote 0
5-10 seconds is also a long time (in the old split MSAccess BE). What is in this query?
 
Upvote 0
It's a SQL statement that is dynamically created depending on who the user is -- after some work on it, I created some views in SQL that load much much faster. Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top