Creating Queries  «Prev 

Creating Query in Design view

Using Query Datasheet

The query datasheet not only looks like the table datasheet, it is like the table datasheet. Just about anything you can do with a table datasheet you can do with a query datasheet. That includes:
  1. Entering data: When you enter data in the query datasheet, the data appears in the underlying table.
  2. Editing data: When you edit data in the query datasheet, the data is changed in the underlying table.
  3. Navigating: You can navigate a query datasheet using all the techniques you learned with the table datasheet.
  4. Printing: Print the datasheet by using the Print button.
  5. Filtering data: You can filter the query datasheet by selection, exclusion, or by form. Of course, it is more permanent to make theBnecessary changes to the query definition by using the query design.
  6. Sorting: Use the Sort Ascending and Sort Descending buttons to sort the data using the field the cursor is in.B
When using a form in Datasheet view, you automatically have the option to sort on any column using the column header (exactly like an Excel spreadsheet).

Specifying how to view the Form

Access uses several properties to determine how a form is viewed. The Default View property determines how the data is displayed when the form is initially opened:
  1. Single Form: Displays one record at a time. Single Form is the default and displays one record per form page, regardless of the form's size.
  2. Continuous Forms: Shows more than one record at a time. Continuous Forms tells Access to display as many detail records as will fit onscreen.
    Figure 3-6 shows a continuous form displaying five records.
  3. Datasheet: Row and column view like a spreadsheet or the standard query Datasheet view.
  4. Split Form: Provides two views of the data at the same time, letting you select a record from a datasheet in the upper section and edit the information in the lower section of the split form.

There are three separate properties to allow the developer to determine if the user can change the default view. These include Allow Form View, Allow Datasheet View, and Allow Layout View. The default setting is Yes for Allow Form View and Allow Layout View and No for Allow Datasheet View. If you set the Allow Datasheet View property to Yes, the Datasheet view commands (in the Views group of the Ribbon, the form's View Shortcuts, and right-click pop-up menu) will be available and the data can be viewed as a datasheet. If you set the Allow Form View property to No, the Form view commands won’t be available.

Removing the Record Selector

The Record Selectors property determines whether the Record Selector (the vertical bar shown in Figure 3-6: on the left side of a form) is displayed. The Record Selector is important in multiple-record forms or datasheets because it points to the current record. A right arrow in the Record Selector indicates the current record, but changes to a pencil icon when the record is being edited. Though the Record Selector is important for datasheets, you probably will not want it for a single record form. To remove the Record Selector, change the form's Record Selectors property to No.

Figure 3-6: The Continuous Forms setting of the Default view property shows multiple records at once.