Folks,
I have an unbound form that contains 4 sub forms and a few unbound controls that I populate OnLoad. The form opens from a ribbon button which fires a function to create a series of queries that get the relevant data from SQL Server ready for the unbound form. This function executes up to the point of running the DoCmd.OpenForm in less than 1 second. There is an amount of code in the OnLoad event that executes in just over 1 second.
However, the entire form takes 10-15 seconds to load.
I have proven that the problem is the DoCmd.OpenForm as I have written debug statements with a timestamp as the line prior to the OpenForm and another debug as the first line inside the OnLoad. The difference between the two debug statements is 10-15 seconds.
All my data comes from SQL Server, but it's not the connectivity to SQL that's my problem. I've checked the speeds there with both debug statements and using profiler.
Can somebody explain exactly what goes on under the hood of DoCmd.OpenForm? It defo isn't just loading the form into memory and firing the OnLoad event.