how to do everything with microsoft office access 2003 phần 3 docx

56 384 0
how to do everything with microsoft office access 2003 phần 3 docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Chapter Enter and Edit Data 90 How to Do Everything with Microsoft Office Access 2003 How to… ■ ■ ■ ■ ■ Enter new data Customize data entry Change the datasheet appearance Edit data in a table Find and replace data Once you have figured out how to distribute your data and built the tables to hold it, it’s time to enter the data and get to work In the last chapter, you saw some design features that keep errors out of your database This chapter discusses more tools that block data errors and speed up the data entry process Enter New Data When you open a new table, it appears in Datasheet view, ready for data entry To add a new record, click the New Record toolbar button or click the New Record navigation button If you prefer menus, choose Edit | Go To | New Record or Insert | New Record You can also simply scroll down to the blank record at the end of the table and start typing When the insertion point moves to an empty field, type in the data If you have specified a custom display format, the entered value will adapt to that format when you move to the next column If you have created an input mask for that field, the mask appears when you enter the field See the section “Add Custom Input Masks” later in this chapter for details about input masks and how they compare with display format settings You can enter date/time data in any valid format; Access will then convert it to the format you’ve specified in the field property However, not try to enter decimal fractions in number fields that are defined as integers because you will lose the decimal by the rounding off to the integer equivalent Copy and Move Data Access provides some shortcuts for entering repetitive data by copying or moving existing data You can copy or move all the data from one record to another or to individual fields or you can move or copy specific items using the Edit menu or toolbar buttons You also can display the clipboard side pane and use it to copy and paste items: ■ Click Copy to add the selected item to the clipboard, then choose Edit | Copy or press CTRL-C CHAPTER 5: Enter and Edit Data 91 ■ Click Cut to move the selected item to the clipboard, then choose Edit | Cut or press CTRL-X When you collect items by copying or cutting them from their source, they are placed on the Office clipboard, which is shared by all Office programs The Office 2003 clipboard is a Task pane that can hold up to 24 items with previews of the text or pictures that have been copied (see Figure 5-1) You can paste them to a new location singly or as a group If you place a 25th item on the clipboard, the first item is deleted The first item on the Office clipboard is also on the Windows clipboard, and you can paste it into almost any other Windows program Similarly, cutting or copying from a non-Office program puts an item on the Windows clipboard, and you can paste it into any Office program, including Access ■ To paste a selected item from the clipboard, place the insertion point where you want to paste it and click Paste, choose Edit | Paste, or press CTRL-V FIGURE 5-1 Copying items to the Office clipboard 92 How to Do Everything with Microsoft Office Access 2003 ■ To delete an item from the clipboard, move the mouse pointer to the item, then click the down arrow to the right of the item and choose Delete from the menu ■ To close the clipboard side pane, click the Close button in the upper-right corner ■ To display the clipboard later, choose Edit | Office Clipboard The Options button at the bottom of the clipboard gives you control over the behavior of the clipboard The options include Show Office Clipboard Automatically, Show Office Clipboard When Control-C Pressed Twice, Collect Without Showing Office Clipboard, Show Office Clipboard Icon On Taskbar, and Show Status Near Taskbar When Copying Copy and Move Within the Same Table You can copy or move one or more records within the same table Once you copy a record, you can add it to the table or replace an existing record with the one you copied To copy a record within the same table: Select the record you want to copy by clicking the record selector (the small gray button to the left of the record) Click the Copy toolbar button or choose Edit | Copy (or press CTRL-C) Click the record selector in the record you want to replace and click Paste (or press CTRL-V) If you want to add the copy as a new record rather than replace an existing one, select the empty record at the bottom of the datasheet, then click Paste (or press CTRL-V) Access tries to save the copied record when you move out of it If the table has a primary key or a unique index, Access won’t let you leave the new record until you have replaced the duplicate value with a unique one If the primary key field is an AutoNumber data type, Access automatically increments the number rather than copying the original number—another good reason to use an AutoNumber field as the primary key To copy more than one record: Select all the records you want to copy before clicking Copy When replacing records, select the same number of existing records as you have placed on the clipboard, then click Paste To append the new records to the table instead of replacing existing ones, select the new empty row at the bottom of the datasheet and click choose Edit | Paste Append Access asks for confirmation when you try to paste multiple records If the table has a primary key or a unique index that is not an AutoNumber, you will not be able to paste multiple records until you remove the key or index Access would have to save all CHAPTER 5: Enter and Edit Data 93 but one of the records, rather than paste a single record, and this would create duplicate values in the field If you try, Access objects by displaying the information message shown here If you just want to repeat the value in a single field to the next record while you are entering data in a new record, you can quickly copy the value by pressing CTRL-’ (apostrophe) after moving to the field If you want to move one or more records rather than create another copy of the data in the record, click Cut instead of Copy This removes the record completely and places it on the clipboard Then use the same paste or append process as described previously for copying records Copy and Move from Another Table If you want to copy or move records from another table, select the records in the source table and click Copy or Cut (If you click Cut, you will be asked to confirm that you wish to delete the record or records from the source table.) Switch to the destination datasheet and select the blank row at the bottom of the datasheet When you click Paste, the new records are added to the destination datasheet The fields in the copied records are pasted in the same order as they appeared in the original datasheet, regardless of the field names You might need to rearrange the columns in the destination datasheet before pasting so they will correspond with the incoming fields Inconsistent data types or sizes between the incoming and the destination records can result in problems If you want to replace certain records in the destination datasheet with records from another table, select the records you want to replace before clicking Paste To append records from another table to the existing datasheet, choose Edit | Paste Append If the source table has more fields than the destination table, the excess fields are not pasted Insert Pictures The Home Tech Repair Employees table has a field reserved for the employees’ badge pictures The Badge Picture field is an OLE (Object Linking and Embedding) Object data type and will store a file containing the digitized photograph The Badge Picture photos are OLE Objects created by a scanner and contained in image files such as tif, gif, or pcx Because the photos 94 How to Do Everything with Microsoft Office Access 2003 Fix Paste Problems When errors occur during a paste operation, Access creates a Paste Errors table and displays a message advising you of the errors as each is added to the table To view the Paste Errors table, double-click the table name in the Tables page of the Database window When you open the Paste Errors table, you might be able to paste the data in the destination table field by field Here are some of the problems you might encounter when trying to paste data into a datasheet: ■ ■ ■ ■ Values are incompatible with the destination data types The value is too long for the destination field The destination is in a hidden column A value violates one of the destination field property settings are not expected to change, they are embedded in the table Additionally, they represent the value stored in the Badge Picture field, which means they are bound to the table records Objects you expect to be edited often are better left in the source program and linked to your table You can store the pathname or filename of the picture or other object in the Text field and won’t have to reimport it when changes occur To insert an image in the Badge Picture field: Place the insertion point in the Badge Picture field and choose Insert | Object, or right-click the field and choose Insert Object from the shortcut menu In the Insert Object dialog box, choose Create from File CHAPTER 5: Enter and Edit Data 95 Type the path and filename of the image file in the File box or click Browse and look for the object Choose OK to embed the picture in the field When you return to Datasheet view, the field now contains the name of the source of the OLE object To see the image, create a form by clicking New Object: AutoForm Figure 5-2 shows an Employee record with the badge picture embedded FIGURE 5-2 The employee’s badge picture inserted 96 How to Do Everything with Microsoft Office Access 2003 You might need to double-click the added object to activate the OLE source program associated with that type of file before you can see the image Insert Hyperlinks A hyperlink is a connection to an object in the same or another Access database, a document created in another program, a document on the Internet, or your local intranet The hyperlink field contains the address of the target object, and when you click the hyperlink, you jump to it If the object is the product of another application, that application is automatically started In the Home Tech Repair database, the Workorders table contains a hyperlink field that contains the engineering drawings for that work order The scanned drawings are saved as gif files in the same folder as the database itself Define the Hyperlink Address A hyperlink address can contain up to four parts, separated by the pound sign (#), as in displaytext#address#subaddress#screentip, of which only the address is required If you want the hyperlink to jump to a specific location in the target object, a subaddress is also required ■ The displaytext is optional and can be displayed in the field in place of the actual address If you don’t include display text, the hyperlink address or subaddress appears instead ■ The address is either a Uniform Resource Locator (URL) such as a web address, or Universal Naming Convention (UNC) path to the document An absolute path starts with \\ and describes the exact location on the system or local area network (LAN) A relative path is related to the current path or the base path specified in the database properties An address is required unless you added a subaddress that points to an object in the current database ■ The subaddress contains a named location within the target object, such as a bookmark in a Word document, a particular slide in a PowerPoint presentation, or a cell range in an Excel spreadsheet ■ The screentip is the text that appears when you rest the mouse pointer on the hyperlink If you don’t specify a ScreenTip, the address is displayed The scanned drawings for the Workorders Drawing field are stored in the Home Tech folder with the database To use the Insert Hyperlink tool to enter the hyperlink address: Place the insertion point in the Drawing field in the Workorders datasheet Click Insert Hyperlink or choose Insert | Hyperlink (see Figure 5-3) Click the Existing File or Web Page button under Link to: if not already chosen Then one of the following: CHAPTER 5: Enter and Edit Data 97 ■ Type the path to the drawing file in the Address box; for example, c:\My Documents\Osborne\fireplace.gif ■ If you have accessed the target of this hyperlink before, you can select it from the list of Recent Files or Browsed Pages ■ Click the Browse for File button (the open folder) and locate the file in the Link to File dialog box and click OK Enter the text you want to show in the field in place of the address in the “Text to display” box For example, you could enter Fireplace If you want to show a ScreenTip, click the ScreenTip button and enter the text in the Set Hyperlink ScreenTip dialog box, then click OK Browse the Web Move up one folder FIGURE 5-3 The Insert Hyperlink dialog box Browse for file 98 How to Do Everything with Microsoft Office Access 2003 Click OK to finish inserting the hyperlink and return to the Workorders datasheet where the hyperlink appears in the Drawing field When you rest the mouse pointer on the hyperlink, you will see the ScreenTip Click the hyperlink to test it; Microsoft Picture Library (or whatever program handles your gif files) opens, displaying the scanned fireplace drawing, as shown in Figure 5-4 Edit and Delete Hyperlinks Editing a hyperlink address is a little different from editing normal text because if you click on the address, you jump to the target There are two ways to edit the address: ■ Right-click the hyperlink, point to Hyperlink in the shortcut menu, and click Edit Hyperlink in the submenu; edit the address directly in the Edit Hyperlink dialog box FIGURE 5-4 The target of the fireplace hyperlink 130 How to Do Everything with Microsoft Office Access 2003 Click Apply Filter Only the eight records of Workorders scheduled to be completed before July 1, 2003 remain on the screen Click Remove Filter or choose Records | Remove Filter/Sort to restore all the records Use Wildcards and Expressions in a Filter You can use wildcards in filter criteria for Text and Memo fields; refer to Chapter for examples of using wildcards In a search, wildcards can be applied only to character strings You can use wildcards to replace individual characters or groups of characters You can also enter an expression as the filter criterion, such as the earlier example of =500 AND ) To add all the fields from a table, click the double right arrow (>>) If you change your mind about including a field, double-click it in the Selected Fields list or select it and click the left arrow (

Ngày đăng: 14/08/2014, 08:22

Từ khóa liên quan

Mục lục

  • PART I Get Started

    • CHAPTER 5 Enter and Edit Data

      • Enter New Data

        • Copy and Move Data

        • Insert Pictures

        • Insert Hyperlinks

        • Customize Data Entry

          • Add Custom Input Masks

          • Create Lookup Fields

          • Change the Datasheet Appearance

            • Move and Resize Columns and Rows

            • Freeze and Hide Columns

            • Change the Font

            • Change Grid Lines and Cell Appearance

            • Set Datasheet Default Options

            • Change Table Definition in Datasheet View

              • Insert/Delete a Subdatasheet

              • Insert/Delete a Column

              • Change Field Names

              • Edit Record Data

                • Locate Records

                • Find and Replace Data

                • Delete Data

                • PART II Retrieve and Present Information

                  • CHAPTER 6 Sort, Filter, and Print Records

                    • Sort Records

                      • Sort on a Single Field

                      • Sort by Two or More Fields

                      • Save the Sort Order

                      • Filter Records

                        • Filter By Selection

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan