The form is initially displayed in Layout view. This creates a form based on the selected object (in this case, the Customers table). Clicking this button will create a form based on the selected table or query. So, ensuring that the Customers table is selected (in the left navigation frame), click the Form button from the CREATE tab on the Ribbon: The “Form” button on the Ribbon – under the “CREATE” tab. So to create a form based on the Customers table, all you need to do is select that table before creating the form. If you select a table or query, Access will automatically create a form based on the selected object. So when a user enters data into the form, that data will be inserted into the Customers table.Īccess makes it easy to create forms like this. We’ll make it a form that enables users to enter new customers.
MICROSOFT ACCESS 2013 TUTORIAL 7 CASE 1 HOW TO
Call it Customer Orders: Saving a queryĬheck out How to Create a Query in Access for an example of how to make some minor modifications to the above query (scroll down to Modifying the Query). Just right click on the Query tab and click Save. If you think you might need a query again, you can save it. When you set up your database correctly (so that it maintains data integrity), you can be confident that your queries will return all applicable results – no more, no fewer. So, queries provide a lot of flexibility for retrieving data and displaying it. We could just as easily have included fields from the Orders table, but we didn’t need them in this case. Of course, this is how we designed the query. Also, it is using a third table ( Orders) but not displaying any fields from that table. Notice the query is displaying fields from two different tables, but it is presented as though it’s a single table. The ResultsĪccess will now display the results of your query: The query results are displayed in Datasheet view. Clicking the View button next to it will also run the query. Set it up like the above screenshot then click the Run button in the Ribbon:Ĭlicking the Run button will run the query. You can choose which tables are shown in the results, which fields to use, add filtering criteria, and more. Query Design View allows you to specify the precise criteria for the query. This allows you to specify the exact criteria you’d like to use in the query. You can also include other queries to use within a query.Īccess will display the Query Design View. Select all, click Add, then click Close: The Show Table dialog allows you to choose which tables to include in the query. You could also use the Query Wizard button next to it to launch the Query Wizard, however, Design view gives you more control over the query.Īccess will ask you to select the tables to include in the query. Click the Query Design button to create a query in Design view. OK, so now that we have data, we can create the query.Ĭlick the Query Design button from the Ribbon. On the Orders table, make sure the values of the CustomerId and ProductId fields match those in their respective primary key fields.This means you won’t be able to enter a value into a foreign key field that doesn’t correspond to a value in the primary key field. You need to do this because we set up the database to enforce referential integrity. Then once all the primary keys are populated, you can enter data into the Orders table. Do the Orders table last. Enter data into the Customers table and the Products table first.Only enter data into the two middle fields of each table. No need to enter data into those fields (remember, one’s an AutoNumber and the other has a Default Value set). The ID fields and DateCreated fields will be populated automatically.You can copy the data from these tables or you can add your own. (If you already have data in your tables, skip this step). Here are the three tables that we created earlier in the tutorial, but this time they contain data. You’ll need to have some data in your tables before you create a query. Simply open it from the database and it’s ready to go. So no need to rebuild the same queries over and over again. Queries can also be saved to the database. But it’s not just any old search.Ī query allows you to specify exactly which fields you want returned, and from which tables.Ī query also lets you add criteria for filtering the data. So for example, you could specify that you only want to see orders worth more than $100, or only products of a particular brand, or only customers who have only ever purchased one item, etc. Queries allow you to “search the database”. Create a macro (so that a multi-step task can be done automatically – at the click of a button).Create a query (so you can “search the database”).This article is Part 3 of the Microsoft Access tutorial.