Expert One-On-One Microsoft® Access Application Development

Expert One-On-One Microsoft® Access Application Development

559044 FM.qxd 3/30/04 2:42 PM Page iii Expert One-on-One Microsoft® Access Application Development Helen Feddema 559044 FM.qxd 3/30/04 2:42 PM Page ii 559044 FM.qxd 3/30/04 2:42 PM Page i Expert One-on-One Microsoft® Access Application Development 559044 FM.qxd 3/30/04 2:42 PM Page ii 559044 FM.qxd 3/30/04 2:42 PM Page iii Expert One-on-One Microsoft® Access Application Development Helen Feddema 559044 FM.qxd 3/30/04 2:42 PM Page iv Expert One-on-One Microsoft® Access Application Development Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 Copyright 2004 by Helen Feddema. Published by Wiley Publishing, Inc. All rights reserved. Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rose- wood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4447, E-mail: [email protected]. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REP- RESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CON- TENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CRE- ATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CON- TAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOT THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FUR- THER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFOR- MATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Trademarks: Wiley, the Wiley Publishing logo, Wrox, the Wrox logo, and Programmer to Programmer are trade- marks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates. Microsoft is a registered trademark of Microsoft Corporation. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Cataloging-in-Publication Data: ISBN: 0-7645-5904-4 Feddema, Helen Bell. Expert one-on-one Microsoft access application development / Helen Feddema. p. cm. Includes index. ISBN 0-7645-5904-4 (paper/website) 1. Microsoft Access. 2. Database management. 3. Computer software—Development. I. Title. QA76.9.D3F4365 2004 005.75’65—dc22 2004001551 Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 1B/RU/QU/QU/IN 559044 FM.qxd 3/30/04 2:42 PM Page v Credits Vice President and Executive Group Publisher Technical Editor Richard Swadley Mary Hardy Vice President and Executive Publisher Senior Production Editor Robert Ipsen Fred Bernardi Vice President and Publisher Development Editor Joseph B. Wikert Emilie Herman Executive Editorial Director Production Editor Mary Bednarek Pamela Hanley Executive Editor Project Coordinator Robert M. Elliott Erin Smith Editorial Manager Text Design & Composition Kathryn A. Malm Wiley Composition Services Proofreading and Indexing TECHBOOKS Production Services 559044 FM.qxd 3/30/04 2:42 PM Page vi 559044 FM.qxd 3/30/04 2:42 PM Page vii Dedication To all the developers who have posted their code on the Internet (and its predecessors) for others to use—you may not have been paid, but your work is appreciated! 559044 FM.qxd 3/30/04 2:42 PM Page viii 559044 FM.qxd 3/30/04 2:42 PM Page ix Contents Acknowledgments xv About the Author xvii Introduction xix Part One: Creating an Access Application 1 Chapter 1: Creating a Database for an Application 3 Gathering Data 4 Figuring Out Business Tasks and Objects 5 Determining Your Entities 5 Creating Tables for an Application 7 Table Creation Methods 8 Creating the Tables 11 Table Field Data Types 16 Normalization 31 First Normal Form: Eliminate Repeating Groups 31 Second Normal Form: Eliminate Redundant Data 31 Third Normal Form: Eliminate Columns Not Dependent on Key 32 Fourth Normal Form: Isolate Independent Multiple Relationships 32 Fifth Normal Form: Isolate Semantically Related Multiple Relationships 33 Setting Up Relationships 33 One-to-Many Relationships 34 One-to-One Relationships 36 Many-to-Many Relationships 37 Summary 38 Chapter 2: Using Forms to Work with Data 39 Form Types 39 Creating the Forms 44 Using the Design Schemes Add-in 44 Creating a Standard Main Form 46 Creating and Embedding Datasheet and Single Form Subforms 57 Creating Continuous Forms 74 Creating a Form for a Many-to-Many Relationship 76 Summary 78 559044 FM.qxd 3/30/04 2:42 PM Page x Contents Chapter 3: Selecting the Right Controls for Forms 79 Standard Controls 79 Useful Standard Controls 80 Not-So-Useful Standard Controls 112 Special Controls 112 Tab Control 112 Calendar Control 113 TreeView Control 114 ActiveX Controls 117 DateTimePicker 117 MonthView Control 118 Summary 119 Chapter 4: Sorting and Filtering Data with Queries 121 Select Queries 121 Basic Select Queries 121 Totals Queries 127 Crosstab Queries 132 Action Queries 136 Append Queries 136 Update Queries 139 Make-Table Queries 145 Delete Queries 146 SQL-specific Queries 147 Union Queries 147 Data-definition Queries 149 Subqueries 151 Summary 153 Chapter 5: Using PivotTables and PivotCharts to Interact with Data 155 Creating a Data Source Query 156 PivotTables 157 The PivotTable Toolbar 164 The PivotTable Properties Sheet 166 PivotCharts 167 The PivotChart Toolbar 171 Embedded PivotCharts 173 Summary 174 x 559044 FM.qxd 3/30/04 2:42 PM Page xi Contents Chapter 6: Printing Data with Reports 175 Report Design Principles 175 The Report Wizard 176 Using Report Templates 179 Tabular Reports 181 Grouped Reports 183 Labels Reports 187 Columnar Reports 189 Reports with Subreports 192 Filtered by Form Reports 193 Summary Reports 197 Special Formatting for Reports 198 Conditional Formatting of Report Controls and Sections 198 Placing a Watermark on a Report 201 Creating a Main Menu with the Menu Manager Add-In 205 Installation 205 Preparation 206 Running the Add-in 208 Summary 212 Chapter 7: Writing VBA Code in Modules 213 The Project Explorer 213 The Properties Sheet 214 The Immediate Window 215 The Module Pane 215 Getting Help 216 Module Types 217 Statements for Use in Modules 217 Call 218 Do While . Loop 218 Do Until . Loop 219 For . Next 219 For Each . Next 220 GoTo 220 If . Then . Else 220 Select Case . End Select 221 With . End With 224 Standard Module Code Samples 224 Using Data in tblInfo 224 Date Range Code on Main Menu 226 xi 559044 FM.qxd 3/30/04 2:42 PM Page xii Contents Code Behind Forms Code Samples 228 New Thing Form 231 Sort and Filter Forms 235 DblClick Event from Datasheet Subform 241 Summary 243 Part Two: Modifying, Updating, and Maintaining Access Applications 245 Chapter 8: Managing the Application Life Cycle 247 Modifying an Application 247 Upgrading to a New Office Version 248 Upgrading an Application to a New Database Format 250 Setting Up Separate Boot Partitions for Different Office Versions 250 Working with Access 2000 Databases in Higher Versions of Access 251 Working with Clients 260 Client Relations 260 Making Client-Requested Changes 261 Application-Specific Changes 261 Standard Changes 274 Customizing the Main Menu’s Word Letters Component 278 Summary 286 Chapter 9: Reworking an Existing Application 287 Applying a Naming Convention 287 The Leszynski Naming Convention 289 Applying the LNC to a Database 295 Creating a Main Menu 302 Normalizing Tables and Relationships 302 Reworking Forms to Enter and Display Many-to-Many Linked Data 309 Reworking the fpriEBookNotes Form 310 Reworking the frmTreeViewEBookNotes Form 315 Creating the New frmAuthors Form 320 Reworking Reports to Enter and Display Many-to-Many Linked Data 321 Summary 328 Chapter 10: Moving Old Data into a New Database 329 Getting at the Old Data 329 Using Queries with Calculated Fields to Append Data from a Non-Normalized Table to a Normalized Table 332 xii 559044 FM.qxd 3/30/04 2:42 PM Page xiii Contents Using VBA Code to Move Data from a Non-Normalized Table to Linked Normalized Tables 341 Denormalizing Data 351 Summary 359 Part Three: Working with Other Office Components (and More) 361 Chapter 11: Working

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    30 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us