Form Creation

T

TaylorLeigh

Is it better to create a form from tables or queries and why do I choose one
over the other.

Thanks,
 
O

Ofer Cohen

It's depend on how many tables you want to base the form on.

If it's one table then base the form on the table.

If its based on more then one table, create a query where you link this
tables, check that the query return the desired records and you can update
this records (if needed) and then base the form on the query.
In any case you don't need to create a query, you can base the form
RecordSurce on this SQL that link tables together.
 
J

John W. Vinson

Is it better to create a form from tables or queries and why do I choose one
over the other.

Thanks,

I'd have to disagree with Ofer here. I routinely base forms on Queries. This
lets you easily specify the sort order of records in the form; limit the
number of records displayed for better performance; select which fields to
display and which to conceal; and even include calculated fields in the query
(for display only, not for editing).

If it's a small table, and you want to see and edit all the fields, and you
don't care about the sort order (or are willing to put up with the hassles of
setting the form's OrderBy property) then a table is ok - but it has no
advantages over a query in my experience.

John W. Vinson [MVP]
 
O

Ofer Cohen

Hi John,

If that what the OP meant there is no disagreament between our point of
views, and I agrea with everything you said.
I always rather base the form on the Table (which mean the RecordSource of
the form is based on the table - as SQL and not as single table, so you can
sort or filter the form)
I wouldn't create a query for the form unless I need to use it in other
objects (another form or report) so if a change is made it will apply to all
the objets related.

For me, less objects as possible.
 
J

John W. Vinson

I always rather base the form on the Table (which mean the RecordSource of
the form is based on the table - as SQL and not as single table, so you can
sort or filter the form)
I wouldn't create a query for the form unless I need to use it in other
objects (another form or report) so if a change is made it will apply to all
the objets related.

Ah. Thanks Ofer, I see the distinction - I'd call that still basing the form
on a query, but just not a *stored* query.

I'll usually store the query so it's a bit easier to reuse it or edit it
independently, but I'd just call that a difference in style.

John W. Vinson [MVP]
 
Top