Then the solution is simple - run the expensive query once, put the result into a TempDB table and use this temporary table as the datasource of your form. By the way, be very careful when using direct SQL queries - don't forget to take into account partitions, companies, table and field permissions, record-level security and so on.
↧