Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data source for a form 2

Status
Not open for further replies.

Gerilee

Programmer
Joined
Mar 23, 2001
Messages
47
Location
US
I am learning Access and am designing an application for users to search, add, update, or delete their data. I used the Form Wizard to create the form for data entry. I am reading for help and during my reading I read --

If you are creating a form meant for data entry
for the database, you should specify where its data
would come from. The object can be a table, a
combination of tables, a query, a combination of
queries, or a combination of tables and queries.

My question is this -- how do you determine where to get the data for a form and when to use a query as your data source? I created the form using the form wizard and just specified the two tables that I need data from. It seems to be working but I keep reading about creating queries to bound to the forms. I understand that queries are needed for calculations, etc. but when else are they needed as the data source for a form? Can I use the same form for data entry, update, and querying the data?
 

You use a query for a source when:

You only want to show a subset of the records in the form - ie only customers in a particur status

You only want to show certain fields - the form is faster to open if it is based on a very large table if you only include fields you need.

You want to show data from more than one table in a single form. (Note that for subforms, you do not need to include both tables on each form)

Setting the form to 'Data Entry' also speeds things up as the dabase does not need to load all the old records.

 
Developers often use queries as the record source for forms because you can control when is seen or not seen. If you have a query as the underlying source of data, then you can use criteria to limit data. You can also get fancy and dynamically change the record source by altering the criteria of the query. You can also use a query to pre-determine sort orders or dynamically change that as well. You can even get in to "query defs" to predetermine what fields that you need. Finally if you have a form that only needs 10 fields and your table has 200 fields, a query will allow you to pick just the fields that you need make your form load and move faster and more efficiently.

Yes, you can use the same for for adding, updating and deleting.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top