Why base Forms on Queries and not Tables?

B

Bam Bam

I've noticed basing Forms on Tables is strongly discouraged but haven't
found any posts that explain why. When creating a form should one
religiously base it on a Query that just relays the appropriate fields from
the table? Could anyone kindly point me in the direction of articles/ pages
that do explain the reasons for basing Forms on Queries?
 
D

Douglas J. Steele

The biggest reason, in my opinion, is that a query allows you to specify the
sort order of the underlying recordset. If you simply base the form on the
table, you have no control whatsoever on what order the records are
presented.
 
R

Rick Brandt

Bam Bam said:
I've noticed basing Forms on Tables is strongly discouraged but haven't
found any posts that explain why. When creating a form should one
religiously base it on a Query that just relays the appropriate fields from
the table? Could anyone kindly point me in the direction of articles/ pages
that do explain the reasons for basing Forms on Queries?

In larger databases (especially multi-user, networked ones), what is key is
always pulling the least amount of records (preferably one) and fields at a time
that allows the user to do his job. If the form will always need all of the
fields in the table then the advantage of a query is in controlling sorting,
doing some calculations that you would otherwise have to do on the form, and it
can be more secured if you are implementing security. Otherwise filtering the
table can be as efficient as using a query.

Often when you see warnings about binding the form directly to the table what is
really being implied is that you are also doing nothing else to increase
efficiency as described above. There is nothing sloppier looking than opening a
bound form and seeing "Record 1 of 150,000" in the navigation bar.

Some of this is semantics. A bound form is always using a query. The "Table"
per se, is just a design construct. When you use the name of a table as the
RecordSource Access is performing a "SELECT * FROM..." in the background. The
same is true when you open a table from the db window. Any time you have access
to data a query is performed.
 
J

joemach

Rick,

Hey, thanks for that explanation. That gives me more understanding
(although I did not ask the question).


joemach
 
Top