In Microsoft Access we can write queries to fetch data from one or more tables (or from other queries). The output you retrieve can be limited by the definition of your query. In MS Access queries are database objects which are used to retrieve a subset of data. MS Access Queries are unlike filters queries, which can be saved and used as a data source for other ms access objects such reports, forms or data access pages. For instance you can write a query to get all students that have a GPA that is less than 3.0 (so you can send them a worming email). Queries are powerful utility because those can be used to retrieve data/information from multiple tables by joining those tables using common fields. Besides limiting the number of records with queries, you can also limit the number of columns or fields. For instance instead of returning all fields from the Student table you can only select the student ID, Student Name, Student GPA and Student Phone number. In short queries are used to change, view, and analyze data.
Need of MS Access Query
MS Access Query proves very useful when tables grow up in size containing hundreds of thousands of records, which makes it difficult and sometimes impossible for the user to pick out specific records from that table. Queries were designed to fight this problem. By using a query you can apply a filter to the table’s data, so that you only get the information that you want.
How to Update Data in a Microsoft Access Query
You can change or update the data in the underlying table by updating data in a Microsoft Access query. Steps for updating data are given below:
First of all open the query in Datasheet view to edit a query based on particular table, on tables with a one-to-one relation, or tables with a one-to-many relationship. Edit the data according to requirement.
If you want to update data automatically update records in a database that is shared on a network, you need to open the query in Datasheet view. Click on the Tools menu, click Options, and then click on Advanced.
Now in the Refresh Interval box, put the number of seconds you want between each automatic update. If you want to update records in linked tables, you need to create and run an Update Action Query.
Some Tips & Warnings
Those tables which can be linked by a Join Line can be updated from a query. You will not be able to update a query that is based on three or more tables joined with many-to-one-to-many relation. You will not be able to edit the data in a crosstab query, certain SQL pass-through queries, a query having unique value property is set to Yes, a query includes linked ODBC tables, or an inconsistent table without a primary key.