Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Exploring the design interface

From: Access 2010: Queries in Depth

Video: Exploring the design interface

All of the queries in Access are stored in a common programming language called SQL. SQL or Structured Query Language is a powerful way to write queries but it can be a bit difficult to read or troubleshoot. Access provides a graphical interface to creating our queries that eliminates much of the tedium involved with reading straight SQL markup. This interface is called the Query Design View. Let's take a look at the various areas of the design interface and how we can begin to build queries using simple mouse clicks. In my navigation pane, I am going to expand the Chapter 1 group and I am going to open up the CustomerEmailandRegion query.

Exploring the design interface

All of the queries in Access are stored in a common programming language called SQL. SQL or Structured Query Language is a powerful way to write queries but it can be a bit difficult to read or troubleshoot. Access provides a graphical interface to creating our queries that eliminates much of the tedium involved with reading straight SQL markup. This interface is called the Query Design View. Let's take a look at the various areas of the design interface and how we can begin to build queries using simple mouse clicks. In my navigation pane, I am going to expand the Chapter 1 group and I am going to open up the CustomerEmailandRegion query.

This opens it up in Record Set view and we can change to the Design view using this button up here on the menu, click on the little triangle and pencil icon. The Query Design view split into two areas. The upper half of the window shows all of the tables that go into building our query; the bottom half of the window shows all of the fields that are in our query. So, we can see that we have two tables that make up the data in our query. We have the tbl_ DirectCustomers and the tlkp_States table. I am going to go ahead and move this down a little bit by clicking on this bar in between and dragging down.

I am also going to rearrange these tables a little bit so I can see all of the fields within each. You can just grab on the corner and drag them open. You can grab on the header and move them over. And now I can see all of the fields that are within each table. I can also see that we have a relationship established between our DirectCustomers table and the States table based off of the State field. We can see that it's a one to many relationship based from state to the abbreviation in the States table. And this was previously established in our Relationships window. From these two tables, we are pulling a series of fields.

We can see that FirstName from the DirectCustomers table, LastName from the DirectCustomers table, Email address from the Customers table and the customer ID from the Customers table. From the States table, we are pulling RegionName and DivisionName. And looking at this, I can also see that we have an ascending sort order based off of the customer ID. If this wasn't here, the query results will be returned based alphabetically off of the FirstName. Let's go ahead and create this query from scratch. We will go up to the Create menu and in the Queries group click on Query Design.

The Show Table window opens up and here we can choose which tables we want to use in our query. Go ahead and double-click on DirectCustomers and States. You can now close the Show Table window. At any point, if you want to add additional tables, there is a couple of ways we can do that. We have a Show Table right up here or and appear or we can right-click in this field and say Show Tables. That will bring up the Show Table window again and we can select additional tables. Let's go ahead and close that out and we will start adding our fields to our query. Let's expand our table so we can see everything again.

From our Customers table, let's choose FirstName and LastName and you can add those just by double-clicking on their names. You can also drag and drop from the Customers table into the field. So, for instance I will grab Email. Drag and drop it into the next open field. Let's go ahead and add DivisionName and RegionName, and I am simply double-clicking. And then finally, we will add our CustID. Again double-click. Under the sorting row for CustID, if you click in this box, you will get a drop down menu of options.

I am going to Ascending. So, we will go from lowest customer ID to highest customer ID. Let's go ahead and run the query and see where we are at. You can either use the View button or Run. And with the Select query, running the query is the exact same as viewing the results. So, either of these buttons will work. They will do the exact same thing for a Select query. I will click Run. And we can see that we have our fields, FirstName, LastName, Email and CustId that are being pulled from our DirectCustomers table. We also have DivisionName and RegionName that are coming from our States table.

Let's go back into the Design view and we will look at a few ways that we can manipulate our grid further. Click on this button to go back into Design view and let's go ahead and take our CustID and move it to the beginning of the query. In order to select the field, there is a tiny gray bar at the very top and when you have the downward pointing arrow, go ahead and click and it will select that field. From there, you can go ahead and click and drag to move the field either left or right if we had further to the right. We can go ahead and move it to the left and drop it at the very beginning. Now, the CustID field is an auto generated number that really doesn't have any real-world data.

it's simply there for Access to keep the record separate. So, we don't really need to see it. We can go ahead and turn off the Show button so that Access will use this field for sorting but it won't use it to actually show up in the results. I can add additional fields to my query just by dragging and dropping them into the place that I want them. For instance, if I want phone number to be inserted between LastName and Email, I can drag it and drop it into the grid, and you will see the Phone number and then Email moved over. We can also use the buttons at the top menu to insert or delete columns. Let's go ahead and delete the Phone number and you will see that Email moved back over to the empty spot.

Let's review our query results by clicking Run and we will see our final query. We have got FirstName, LastName, Email, Division and Region, and everything is being sorted based off of the customer ID number, not alphabetically. So, while the wizard will be able to quickly create a very simple query within your database, it really only scratches the surface of what is possible in the Query Design View. For more complex tasks or to troubleshoot and modify your queries, the design interface will be your go to tool. As we'll see throughout this title, the design interface allows us to visualize how are queries are constructed, which minimizes entry errors and gives us greater control over our query record sets.

Show transcript

This video is part of

Image for Access 2010: Queries in Depth
Access 2010: Queries in Depth

46 video lessons · 13449 viewers

Adam Wilbert
Author

 
Expand all | Collapse all
  1. 9m 9s
    1. Welcome
      1m 10s
    2. Using the exercise files
      41s
    3. Introducing the database
      4m 29s
    4. Previewing the course
      2m 49s
  2. 17m 17s
    1. Understanding queries
      3m 31s
    2. Following naming conventions and best practices
      2m 56s
    3. Using the Query Wizard
      5m 21s
    4. Exploring the design interface
      5m 29s
  3. 26m 39s
    1. Defining criteria
      5m 40s
    2. Understanding comparison operators
      3m 19s
    3. Defining the column headers
      2m 49s
    4. Exploring the property sheet
      7m 32s
    5. Printing query results
      2m 41s
    6. Working with joins
      4m 38s
  4. 14m 14s
    1. Understanding parameter queries
      4m 27s
    2. Obtaining parameters from forms
      5m 17s
    3. Creating a combo box
      4m 30s
  5. 23m 24s
    1. Understanding the Totals field
      5m 31s
    2. Creating aggregate calculations
      3m 31s
    3. Exploring the Expression Builder interface
      4m 28s
    4. Using mathematical operators
      5m 46s
    5. Applying text functions
      4m 8s
  6. 24m 23s
    1. Understanding dates as serial numbers
      2m 42s
    2. Specifying a range of dates or times
      3m 47s
    3. Formatting dates
      4m 31s
    4. Using other Date/Time functions
      3m 47s
    5. Defining today's date
      2m 41s
    6. Calculating time intervals
      6m 55s
  7. 20m 9s
    1. Introducing the conditional IIf function
      2m 57s
    2. Creating an IIf function
      7m 31s
    3. Nesting IIf functions
      4m 57s
    4. Using the Switch function
      4m 44s
  8. 20m 41s
    1. Understanding the reporting tool
      2m 13s
    2. Building the form
      6m 57s
    3. Building the query
      5m 4s
    4. Building the report
      3m 30s
    5. Finalizing the reporting tool
      2m 57s
  9. 25m 37s
    1. Finding duplicate records
      2m 17s
    2. Identifying unmatched records
      2m 29s
    3. Creating crosstab results
      2m 57s
    4. Creating backups
      1m 29s
    5. Creating update queries
      3m 22s
    6. Making, deleting, and appending records
      5m 36s
    7. Uniting tables
      3m 16s
    8. Embedding SQL code in queries
      4m 11s
  10. 1m 0s
    1. Next Steps
      1m 0s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Access 2010: Queries in Depth.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.