Always use a query to fill a subform?

Juan

Registered User.
Local time
Today, 10:30
Joined
Feb 16, 2006
Messages
32
Hi everyone

I've seen a number of threads here, as well as elsewhere, which suggest that it's good practice to use a query to provide data to a subform, rather than placing data directly from the table.

I can understand the need for this if a special function of the query is needed, such as selecting certain records, performing calculations with some fields, reordering the information etc., but what if the data is to be transferred without any such manipulation? Is it still better practice to put the data through a query (that simply takes all fields from the table and doesn't modify anything) or take it directly from the table to the subform?

My "gut" feeling is that it wastes time (albeit a fraction of a second!) to have an extra step between the table and subform and, I suppose, another step where something could go wrong.

Is my logic correct, or is it ALWAYS good practice to use a query to supply data to a subform. If the latter, I will change my practice and use more queries.

Thanks for your responses.
 
Forms are always based on queries regardless of whether the RecordSource specifies a table, a querydef, or an SQL string. The difference is that when you reference a table, Access creates a query for you. The problem is that the query is unordered. If you are working with only small sets of data and you compact the database every day, you may never notice that sometimes records are out of order.

Create your own query and include at a minimum an order by clause.

A relational table is not at all like a flat file. YOU never look at a table directly. The table is ALWAYS accessed via a query whether you create it or Access creates it for you.
 
Thank you Pat. That makes the situation clear for me now. I thought there must be a good reason why I'd seen the suggestion to use a query, rather than a table. I'll change my practice now.
 

Users who are viewing this thread

Back
Top Bottom