100% found this document useful (1 vote)
13 views85 pages

Microsoft Access 2007 Data Analysis With Source Code Michael Alexander download

The document is a promotional listing for the book 'Microsoft Access 2007 Data Analysis' by Michael Alexander, which includes various chapters on data analysis techniques and fundamentals using Microsoft Access. It also provides links to other related eBooks and resources for further learning. The book is published by Wiley Publishing, Inc. and is aimed at users looking to enhance their data analysis skills with Access.

Uploaded by

elbararomal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
13 views85 pages

Microsoft Access 2007 Data Analysis With Source Code Michael Alexander download

The document is a promotional listing for the book 'Microsoft Access 2007 Data Analysis' by Michael Alexander, which includes various chapters on data analysis techniques and fundamentals using Microsoft Access. It also provides links to other related eBooks and resources for further learning. The book is published by Wiley Publishing, Inc. and is aimed at users looking to enhance their data analysis skills with Access.

Uploaded by

elbararomal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

Microsoft Access 2007 Data Analysis With Source

Code Michael Alexander download

https://ebookbell.com/product/microsoft-access-2007-data-
analysis-with-source-code-michael-alexander-972588

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Access 2007 Vba Bible For Datacentric Microsoft Office Applications


Helen Bell Feddema

https://ebookbell.com/product/access-2007-vba-bible-for-datacentric-
microsoft-office-applications-helen-bell-feddema-4096374

Mcitp Developer Microsoft Sql Server 2005 Data Access Design And
Optimization Study Guide Exam 70442 Marilyn Millerwhite

https://ebookbell.com/product/mcitp-developer-microsoft-sql-
server-2005-data-access-design-and-optimization-study-guide-
exam-70442-marilyn-millerwhite-1355042

Mcitp Selfpaced Training Kit Exam 70442 Designing And Optimizing Data
Access By Using Microsoft Sql Servertm 2005 Selfpaced Training Kits
1st Edition Sara Morgan

https://ebookbell.com/product/mcitp-selfpaced-training-kit-
exam-70442-designing-and-optimizing-data-access-by-using-microsoft-
sql-servertm-2005-selfpaced-training-kits-1st-edition-sara-
morgan-2164406

Microsoft Access 2007 A Professional Approach Spi Jon Juarez

https://ebookbell.com/product/microsoft-access-2007-a-professional-
approach-spi-jon-juarez-10960252
Microsoft Office Access 2007 Forms Reports And Queries 2nd Paul
Mcfedries

https://ebookbell.com/product/microsoft-office-access-2007-forms-
reports-and-queries-2nd-paul-mcfedries-2015854

Microsoft Office Access 2007 The Complete Reference 1st Edition


Virginia Andersen

https://ebookbell.com/product/microsoft-office-access-2007-the-
complete-reference-1st-edition-virginia-andersen-972678

Microsoft Office Access 2007 Brief Brief Linda Oleary

https://ebookbell.com/product/microsoft-office-access-2007-brief-
brief-linda-oleary-10960264

Microsoft Office Access 2007 The Complete Reference Andersen

https://ebookbell.com/product/microsoft-office-access-2007-the-
complete-reference-andersen-1267664

Microsoft Office Access 2007 On Demand Steve Johnson Steve Perspection


Inc

https://ebookbell.com/product/microsoft-office-access-2007-on-demand-
steve-johnson-steve-perspection-inc-1355476
01_104859 ffirs.qxp 2/20/07 3:02 PM Page iii

Microsoft® Access™ 2007


Data Analysis

Michael Alexander
01_104859 ffirs.qxp 2/20/07 3:02 PM Page ii
01_104859 ffirs.qxp 2/20/07 3:02 PM Page i

Microsoft® Access™ 2007


Data Analysis
01_104859 ffirs.qxp 2/20/07 3:02 PM Page ii
01_104859 ffirs.qxp 2/20/07 3:02 PM Page iii

Microsoft® Access™ 2007


Data Analysis

Michael Alexander
01_104859 ffirs.qxp 2/20/07 3:02 PM Page iv

Microsoft® Access™ 2007 Data Analysis


Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-10485-9
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
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 Sections 107 or 108 of the 1976 United States Copy-
right 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, 222
Rosewood 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-4355, or
online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no repre-
sentations or warranties with respect to the accuracy or completeness of the contents of this
work and specifically disclaim all warranties, including without limitation warranties of fit-
ness for a particular purpose. No warranty may be created or extended by sales or promo-
tional materials. The advice and strategies contained herein may not be suitable for every
situation. This work is sold with the understanding that the publisher is not engaged in ren-
dering legal, accounting, or other professional services. If professional assistance is
required, the services of a competent professional person should be sought. Neither the
publisher nor the author shall be liable for damages arising herefrom. The fact that an orga-
nization 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 information
the organization or Website may provide or recommendations it may make. Further, read-
ers should be aware that Internet Websites listed in this work may have changed or disap-
peared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support,
please contact our Customer Care Department within the U.S. at (800) 762-2974, outside the
U.S. at (317) 572-3993 or fax (317) 572-4002.
Library of Congress Cataloging-in-Publication Data Available from Publisher
Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered
trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other
countries, and may not be used without written permission. Microsoft and Access are trade-
marks or registered trademarks of Microsoft Corporation in the United States and/or other
countries. All other trademarks are the property of their respective owners. Wiley Publish-
ing, 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.
01_104859 ffirs.qxp 2/20/07 3:02 PM Page v

For Mary, Ethan, and Emma


01_104859 ffirs.qxp 2/20/07 3:02 PM Page vi
01_104859 ffirs.qxp 2/20/07 3:02 PM Page vii

About the Author

Michael Alexander is a Microsoft Certified Application Developer


(MCAD) with more than 14 years experience consulting and developing
office solutions. He currently lives in Plano, TX where he serves as a Senior
Program Manager for a top technology firm. In his spare time he runs a free
tutorial site, www.datapigtechnologies.com, where he shares basic
Access and Excel tips to the Office community.

vii
01_104859 ffirs.qxp 2/20/07 3:02 PM Page viii
01_104859 ffirs.qxp 2/20/07 3:02 PM Page ix

Credits

Acquisitions Editor Project Coordinator


Katie Mohr Patrick Redmond
Development Editor Graphics and Production
Kelly Talbot Specialists
Jennifer Mayberry, Barbara Moore,
Technical Editor
Rashelle Smith
Todd Meister
Quality Control Technician
Production Editor
John Greenough
Angela Smith
Proofreading
Copy Editor
Lisa Stiers
Travis Henderson
Indexing
Editorial Manager
Aptara
Mary Beth Wakefield
Anniversary Logo Design
Production Manager
Richard J. Pacifico
Tim Tate
Vice President and Executive
Group Publisher
Richard Swadley
Vice President and Executive
Publisher
Joseph B. Wikert

ix
01_104859 ffirs.qxp 2/20/07 3:02 PM Page x
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xi

Contents

About the Author ix


Acknowledgments xix
Introduction xxi
Part I Fundamentals of Data Analysis in Access 1
Chapter 1 The Case for Data Analysis in Access 3
Where Data Analysis with Excel Can Go Wrong 3
Scalability 4
Transparency of Analytical Processes 6
Separation of Data and Presentation 7
Deciding Whether to Use Access or Excel 8
Size of Data 9
Data Structure 9
Data Evolution 9
Functional Complexity 10
Shared Processing 10
An Excel User’s Guide to Access: Don’t Panic! 10
Tables 11
Queries 11
Reports 12
Macros and VBA 12
Summary 13
Chapter 2 Access Basics 15
Access Tables 15
Table Basics 16
Opening a Table in the Datasheet View 16
Identifying Important Table Elements 17

xi
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xii

xii Contents

Opening a Table in the Design View 17


Exploring Data Types 19
Before Creating a Table 20
Creating a Table with Design View 21
Field Properties 24
Primary Key 26
Getting Data into Access 28
Importing 28
Linking 28
Things to Remember About Importing Data 28
Importing Data from an Excel Spreadsheet 29
Importing Data from a Text File 30
Understanding the Relational Database Concept 30
Why Is This Concept Important? 30
Excel and the Flat-File Format 31
Splitting Data into Separate Tables 33
Foreign Keys 34
Relationship Types 34
Referential Integrity 36
Cascading Updates and Deletes 37
Query Basics 37
What Is a Query? 37
Creating Your First Select Query 37
Sorting Query Results 40
Filtering Query Results 42
Querying Multiple Tables 43
Refining the Query 45
Using Operators in Queries 46
Exporting Query Results 49
Summary 49
Chapter 3 Beyond Select Queries 51
Aggregate Queries 51
Creating an Aggregate Query 52
About Aggregate Functions 56
Group By 56
Sum, Avg, Count, StDev, Var 57
Min, Max, First, Last 58
Expression, Where 58
Action Queries 61
Why Use Action Queries? 62
Make-Table Queries 62
Why Use a Make-Table Query? 62
What Are the Hazards of Make-Table Queries? 62
Creating a Make-Table Query 63
Delete Queries 65
Why Use a Delete Query? 65
What Are the Hazards of Delete Queries? 65
Creating a Delete Query 66
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xiii

Contents xiii

Append Queries 68
Why Use an Append Query? 68
What Are the Hazards of Append Queries? 69
Creating an Append Query 71
Update Queries 74
Why Use an Update Query? 75
What Are the Hazards of Update Queries? 75
Creating an Update Query 75
A Word on Updatable Datasets 78
Crosstab Queries 78
Using the Crosstab Query Wizard 79
Creating a Crosstab Query Manually 84
Using the Query Design Grid to Create Your Crosstab
Query 85
Customizing Your Crosstab Queries 88
Summary 90
Part II Basic Analysis Techniques 93
Chapter 4 Transforming Your Data with Access 95
Finding and Removing Duplicate Records 96
Defining Duplicate Records 96
Finding Duplicate Records 97
Removing Duplicate Records 100
Common Transformation Tasks 102
Filling in Blank Fields 102
Concatenating 104
Concatenating Fields 104
Augmenting Field Values with Your Own Text 105
Changing Case 107
Removing Leading and Trailing Spaces from a String 109
Finding and Replacing Specific Text 110
Adding Your Own Text in Key Positions Within a String 112
Parsing Strings Using Character Markers 116
Query 1 118
Query 2 119
Summary 120
Chapter 5 Working with Calculations and Dates 121
Using Calculations in Your Analysis 121
Common Calculation Scenarios 122
Using Constants in Calculations 122
Using Fields in Calculations 123
Using the Results of Aggregation in Calculations 124
Using the Results of One Calculation as an Expression
in Another 124
Using a Calculation as an Argument in a Function 125
Using the Expression Builder to Construct Calculations 126
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xiv

xiv Contents

Common Calculation Errors 130


Understanding the Order of Operator Precedence 130
Watching Out for Null Values 131
Watching the Syntax in Your Expressions 133
Using Dates in Your Analysis 134
Simple Date Calculations 134
Advanced Analysis Using Functions 135
The Date Function 135
The Year, Month, Day, and Weekday Functions 139
The DateAdd function 141
Grouping Dates into Quarters 143
The DateSerial Function 145
Summary 146
Chapter 6 Performing Conditional Analysis 149
Using Parameter Queries 149
How Parameter Queries Work 151
Ground Rules of Parameter Queries 151
Working with Parameter Queries 152
Working with Multiple Parameter Conditions 152
Combining Parameters with Operators 153
Combining Parameters with Wildcards 154
Using Parameters as Calculation Variables 155
Using Parameters as Function Arguments 156
Using Conditional Functions 159
The IIf Function 159
Using IIf to Avoid Mathematical Errors 159
Using IIf to Save Time 161
Nesting IIf Functions for Multiple Conditions 163
Using IIf Functions to Create Crosstab Analyses 164
The Switch Function 166
Comparing the IIf and Switch Functions 167
Summary 169
Part III Advanced Analysis Techniques 171
Chapter 7 Understanding and Using SQL 173
Understanding Basic SQL 173
The SELECT Statement 175
Selecting Specific Columns 175
Selecting All Columns 176
The WHERE Clause 176
Making Sense of Joins 177
Inner Joins 177
Outer Joins 178
Getting Fancy with Advanced SQL Statements 179
Expanding Your Search with the Like Operator 180
Selecting Unique Values and Rows without Grouping 181
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xv

Contents xv

Grouping and Aggregating with the GROUP BY Clause 182


The HAVING Clause 183
Setting Sort Order with the ORDER BY Clause 183
Creating Aliases with the AS Clause 183
Creating a Column Alias 184
Creating a Table Alias 184
SELECT TOP and SELECT TOP PERCENT 184
Top Values Queries Explained 184
SELECT TOP 186
SELECT TOP PERCENT 187
Performing Action Queries via SQL Statements 187
Make-Table Queries Translated 187
Append Queries Translated 188
Update Queries Translated 188
Delete Queries Translated 188
Creating Crosstabs with the TRANSFORM Statement 188
Using SQL Specific Queries 189
Merging Datasets with the UNION Operator 189
Creating a Table with the CREATE TABLE Statement 191
Manipulating Columns with the ALTER TABLE Statement 192
Adding a Column with the ADD Clause 192
Altering a Column with the ALTER COLUMN Clause 193
Deleting a Column with the DROP COLUMN Clause 193
Summary 193
Chapter 8 Subqueries and Domain Aggregate Functions 195
Enhancing Your Analysis with Subqueries 196
Why Use Subqueries? 197
Subquery Ground Rules 197
Creating Subqueries without Typing SQL Statements 198
Using IN and NOT IN with Subqueries 201
Using Subqueries with Comparison Operators 201
Using Subqueries as Expressions 202
Using Correlated Subqueries 203
Uncorrelated Subqueries 203
Correlated Subqueries 203
Using a Correlated Subquery as an Expression 205
Using Subqueries within Action Queries 205
A Subquery in a Make-Table Query 205
A Subquery in an Append Query 205
A Subquery in an Update Query 206
A Subquery in a Delete Query 206
Domain Aggregate Functions 208
Understanding the Different Domain Aggregate Functions 210
DSum 210
DAvg 210
DCount 211
DLookup 211
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xvi

xvi Contents

DMin and DMax 211


DFirst and DLast 211
DStDev, DStDevP, DVar, and DvarP 211
Examining the Syntax of Domain Aggregate Functions 212
Using No Criteria 212
Using Text Criteria 212
Using Number Criteria 213
Using Date Criteria 213
Using Domain Aggregate Functions 214
Calculating the Percent of Total 214
Creating a Running Count 215
Using a Value from the Previous Record 217
Summary 219
Chapter 9 Running Descriptive Statistics in Access 221
Basic Descriptive Statistics 222
Running Descriptive Statistics with Aggregate Queries 222
Determining Rank, Mode, and Median 223
Ranking the Records in Your Dataset 224
Getting the Mode of a Dataset 225
Getting the Median of a Dataset 227
Pulling a Random Sampling from Your Dataset 229
Advanced Descriptive Statistics 231
Calculating Percentile Ranking 231
Determining the Quartile Standing of a Record 233
Creating a Frequency Distribution 235
Summary 240
Chapter 10 Analyzing Data with Pivot Tables and Pivot Charts 241
Pivot Tables in Access? 242
The Anatomy of a Pivot Table 243
The Totals and Detail Area 243
The Row Area 244
The Column Area 245
The Filter Area 245
Creating a Basic Pivot Table 246
Creating an Advanced Pivot Table with Details 250
Saving Your Pivot Table 252
Sending Your Access Pivot Table to Excel 253
Pivot Table Options 254
Expanding and Collapsing Fields 255
Changing Field Captions 255
Sorting Data 256
Grouping Data 256
Using Date Groupings 259
Filtering for Top and Bottom Records 260
Adding a Calculated Total 261
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xvii

Contents xvii

Working with Pivot Charts in Access 265


The Data Area 265
The Series Area 265
The Category Area 266
The Filter Area 267
Creating a Basic Pivot Chart 268
Formatting Your Pivot Chart 269
Summary 272
Part IV Automating Data Analysis 353
Chapter 11 Scheduling and Running Batch Analysis 275
Introduction to Access Macros 276
Dealing with Access 2007 Security Features 277
The Quick Fix 278
The Long-Term Fix 279
Creating Your First Macro 280
Essential Macro Actions 282
Manipulating Forms, Queries, Reports, and Tables 283
The Access Environment 283
Executing Processes 284
Outputting Data 284
Setting Up and Managing Batch Analysis 285
Getting Organized 285
Using a Logical Naming Convention 285
Using the Description Property 288
Setting Up a Basic Batch Analysis 289
Building Smarter Macros 291
Simulating If...Then 292
Simulating If...Then...Else 294
Looping with Macros 296
Scheduling Macros to Run Nightly 301
Using an AutoExec Macro to Schedule Tasks 301
Using the Windows Task Scheduler 302
Using Command Lines to Schedule Tasks 307
When to Use Command Lines to Schedule Tasks
Instead of AutoExec 308
Scheduling a Macro to Run Using a Command Line 308
Summary 310
Chapter 12 Leveraging VBA to Enhance Data Analysis 311
Creating and Using Custom Functions 312
Creating Your First Custom Function 313
Creating a Custom Function that Accepts Arguments 315
Controlling Analytical Processes with Forms 319
The Basics of Passing Data from a Form to a Query 320
Enhancing Automation with Forms 324
Enumerating Through a Combo Box 326
02_104859 ftoc.qxp 2/17/07 12:49 AM Page xviii

xviii Contents

Processing Data Behind the Scenes 329


Processing Data with RunSQL Statements 330
The Basics of the RunSQL Method 330
Using RunSQL Statements 331
Advanced Techniques Using RunSQL Statements 332
Suppressing Warning Messages 332
Passing a SQL Statement as a Variable 332
Passing User-Defined Parameters from a Form to Your
SQL Statement 333
Summary 337
Chapter 13 Query Performance, Database Corruption, and Other
Final Thoughts 339
Optimizing Query Performance 339
Understanding the Access Query Optimizer 339
Steps You Can Take to Optimize Query Performance 340
Normalizing Your Database Design 340
Using Indexes on Appropriate Fields 341
Optimizing by Improving Query Design 342
Compacting and Repairing Your Database Regularly 343
Handling Database Corruption 344
Signs and Symptoms of a Corrupted Database 344
Watching for Corruption in Seemingly Normal Databases 344
Common Errors Associated with Database Corruption 345
Recovering a Corrupted Database 347
Steps You Can Take to Prevent Database Corruption 348
Backing Up Your Database on a Regular Basis 348
Compacting and Repairing Your Database on a Regular
Basis 348
Avoiding Interruption of Service while Writing to Your
Database 349
Never Working with a Database from Removable Media 350
Getting Help in Access 350
Location Matters When Asking for Help 350
Online Help Is Better than Off-Line Help 351
Diversifying Your Knowledgebase with Online Resources 351
Summary 351
Part V Appendixes 353
Appendix A Data Analyst’s Function Reference 355
Appendix B Access VBA Fundamentals 397
Appendix C Error Message Reference 411
Index 491
03_104859 flast.qxp 2/17/07 12:49 AM Page xix

Acknowledgments

A big thank you to Katie Mohr for taking a chance on this project and being
such a wonderful project manager. Many thanks to Kelly Talbot, Todd Meister,
and the brilliant team of professionals who helped bring this book to
fruition. A special thank you to Mary who puts up with all my crazy projects.

xix
03_104859 flast.qxp 2/17/07 12:49 AM Page xx
03_104859 flast.qxp 2/17/07 12:49 AM Page xxi

Introduction

If you were to ask a random sampling of people what data analysis is, most
would say that it is the process of calculating and summarizing data to get
an answer to a question. In one sense, they are correct. However, the
actions they are describing represent only a small part of the process
known as data analysis.
For example, if you were asked to analyze how much revenue in sales
your company made last month, what would you have to do in order to
complete that analysis? You would just calculate and summarize the sales
for the month, right? Well, where would you get the sales data? Where
would you store the data? Would you have to clean up the data when you
got it? How would you present your analysis: by week, by day, by loca-
tion? The point being made here is that the process of data analysis is made
up of more than just calculating and summarizing data.
A more representative definition of data analysis is the process of sys-
tematically collecting, transforming, and analyzing data in order to present
meaningful conclusions. To better understand this concept, think of data
analysis as a process that encapsulates four fundamental actions: collec-
tion, transformation, analysis, and presentation.
■■ Collection: Collection encompasses the gathering and storing of
data—that is, where you obtain your data, how you will receive
your data, how you will store your data, and how you will access
your data when it comes time to perform some analysis.
■■ Transformation: Transformation is the process of ensuring your
data is uniform in structure, free from redundancy, and stable. This

xxi
03_104859 flast.qxp 2/17/07 12:49 AM Page xxii

xxii Introduction

generally entails things like establishing a table structure, cleaning


text, removing blanks, and standardizing data fields.
■■ Analysis: Analysis is the investigation of the component parts of
your data and their relationships to your data source as a whole. You
are analyzing your data when you are calculating, summarizing, cat-
egorizing, comparing, contrasting, examining, or testing your data.
■■ Presentation: In the context of data analysis, presentation deals with
how you make the content of your analysis available to a certain
audience. That is, how you choose to display your results. Some
considerations that go along with presentation of your analysis
include the platform you will use, the levels of visibility you will
provide, and the freedom you will give your audience to change
their view.
As you think about these four fundamental actions, think about this
reality: Most analysts are severely limited to one tool—Excel. This means
that all of the complex actions involved in each of these fundamentals
are mostly being done with and in Excel. What’s the problem with that?
Well Excel is not designed to do many of these actions. However, many
analysts are so limited in their toolsets that they often end up in hand-to-
hand combat with their data, creating complex workarounds and ineffi-
cient processes.
What this book will highlight is that there are powerful functionalities in
Access that can help you go beyond your two-dimensional spreadsheet
and liberate you from the daily grind of managing and maintaining redun-
dant analytical processes. Indeed, using Access for your data analysis
needs can help you streamline your analytical processes, increase your
productivity, and analyze the larger datasets that have reached Excel’s
limitations.
Throughout this book, you will come to realize that Access is not a dry
database program used only for storing data and building departmental
applications. Access possesses strong data analysis functionalities that are
easy to learn and certainly applicable to many types of organizations and
data systems.

What to Expect from This Book


Within the first three chapters, you will be able to demonstrate proficiency
in Access, executing powerful analysis on large datasets that have long
since reached Excel’s limitations. Within the first nine chapters, you will be
able to add depth and dimension to your analysis with advanced Access
functions, building complex analytical processes with ease. By the end of
03_104859 flast.qxp 2/17/07 12:49 AM Page xxiii

Introduction xxiii

the book, you will be able to create your own custom functions, perform
batch analysis, and develop automated procedures that essentially run on
their own.
After completing this book, you will be able to analyze large amounts of
data in a meaningful way, quickly slice data into various views on the fly,
automate redundant analysis, save time, and increase productivity.

What to Not Expect from This Book


It’s important to note that there are aspects of Access and data analysis that
are outside the scope of this book. While this book does cover the funda-
mentals of Access, it is always in the light of data analysis and it is written
from a data analyst’s point of view. This is not meant to be an all-encom-
passing book on Access. That being said, if you are a first-time user of
Access, you can feel confident that this book will provide you with a solid
introduction to Access that will leave you with valuable skills you can use
in your daily operations.
This book is not meant to be a book on data management theory and best
practices. Nor is it meant to expound on high-level business intelligence
concepts. This is more of a “technician’s” book, providing hands-on
instruction that introduces Access as an analytical tool that can provide
powerful solutions to common analytical scenarios and issues.
Finally, while this book does contain a chapter that demonstrates various
techniques to perform a whole range of statistical analysis, it is important
to note that this book does not cover statistics theory, methodology, or best
practices.

Skills Required for This Book


In order to get the most out of this book, it’s best that you have certain skills
before diving into the topics highlighted in this book. The ideal candidate
for this book will have:
■■ Some experience working with data and familiarity with the basic
concepts of data analysis such as working with tables, aggregating
data, and performing calculations.
■■ Experience using Excel with a strong grasp of concepts such as table
structures, filtering, sorting and using formulas.
■■ Some basic knowledge of Access; enough to know it exists and to
have opened a database once or twice.
03_104859 flast.qxp 2/17/07 12:49 AM Page xxiv

xxiv Introduction

How This Book Is Organized


Part I: Fundamentals of Data Analysis in Access
Part I, which includes Chapters 1, 2, and 3, provides a condensed intro-
duction to Access. Here, you will learn some of the basic fundamentals of
Access, along with the essential query skills required throughout the rest of
the book. Topics covered in this Part are: relational database concepts,
query basics, using aggregate queries, action queries, and Crosstab
queries.

Part II: Basic Analysis Techniques


Part II will introduce you to some of the basic analytical tools and tech-
niques available to you in Access. Chapter 4 covers data transformation,
providing examples of how to clean and shape raw data to fit your needs.
Chapter 5 provides in-depth instruction on how to create and utilize custom
calculations in your analysis. Chapter 5 also shows you how to work with
dates, using them in simple date calculations, or performing advanced time
analysis. Chapter 6 introduces you to some conditional analysis techniques
that allow you to add logic to your analytical processes.

Part III: Advanced Analysis Techniques


Part III will demonstrate many of the advanced techniques that truly bring
your data analysis to the next level. Chapter 7 covers the fundamentals
SQL statements. Chapter 8 picks up from there and introduces you to sub-
queries and domain aggregate functions. Chapter 9 demonstrates many of
the advanced statistical analysis you can perform using subqueries and
domain aggregate functions. Chapter 10 provides you with an in-depth
look at using PivotTables and PivotCharts in Access.

Part IV: Automating Data Analysis


Part IV takes you beyond manual analysis with queries and introduces you
to the world of automation. Chapter 11 gives you an in-depth view of how
macros can help increase you productivity by running batch analysis.
Chapter 12 demonstrates how a little coding with Visual Basic for Applica-
tions (VBA) can help enhance data analysis. Chapter 13 offers some final
thoughts and tips on query performance, database corruption, and how to
get help in Access.
03_104859 flast.qxp 2/17/07 12:49 AM Page xxv

Introduction xxv

Part V: Appendixes
Part V includes useful reference materials that will assist you in your
everyday dealings with Access. Appendix A details many of the built-in
Access functions that are available to data analysts. Appendix B provides a
high-level overview of VBA for those users who are new to the world of
Access programming. Appendix C highlights and explains many of the
Access error codes you may encounter while analyzing your data.

Companion Database
The examples demonstrated throughout this book can be found in the
companion database. This sample database is located at www.wiley.com/
go/access2007dataanalysis.
03_104859 flast.qxp 2/17/07 12:49 AM Page xxvi
03_104859 flast.qxp 2/17/07 12:49 AM Page xxvii

Microsoft® Access™ 2007


Data Analysis
03_104859 flast.qxp 2/17/07 12:49 AM Page xxviii
04_104859 pt01.qxp 2/17/07 12:50 AM Page 1

PA R T

I
Fundamentals of Data
Analysis in Access
04_104859 pt01.qxp 2/17/07 12:50 AM Page 2
05_104859 ch01.qxp 2/17/07 12:50 AM Page 3

CHAPTER

1
The Case for Data Analysis
in Access

When you ask most people which software tool they use for their daily
data analysis, the answer you most often get is Excel. Indeed, if you were
to enter the key words data analysis in an Amazon.com search, you would
get a plethora of books on how to analyze your data with Excel. Well if so
many people seem to agree that using Excel to analyze data is the way to
go, why bother using Access for data analysis? The honest answer: to avoid
the limitations and issues that plague Excel.
This is not meant to disparage Excel or its wonderful functionalities.
Many people have used Excel for years and continue to use it every day. It
is considered to be the premier platform for performing and presenting data
analysis. Anyone who does not understand Excel in today’s business world
is undoubtedly hiding that shameful fact. The interactive, impromptu
analysis that Excel can perform makes it truly unique in the industry.
However, it is not without its limitations, as you will see in the following
section.

Where Data Analysis with Excel Can Go Wrong


Years of consulting experience have brought me face to face with man-
agers, accountants, and analysts who all have had to accept one simple

3
05_104859 ch01.qxp 2/17/07 12:50 AM Page 4

4 Part I ■ Fundamentals of Data Analysis in Access

fact: their analytical needs had outgrown Excel. They all met with funda-
mental issues that stemmed from one or more of Excel’s three problem
areas: scalability, transparency of analytical processes, and separation of
data and presentation.

Scalability
Scalability is the ability for an application to develop flexibly to meet
growth and complexity requirements. In the context of this chapter, scala-
bility refers to the ability of Excel to handle ever-increasing volumes of
data. Most Excel aficionados will be quick to point out that as of Excel 2007,
you can place 1,048,576 rows of data into a single Excel worksheet. This is
an overwhelming increase from the limitation of 65,536 rows imposed by
previous versions of Excel. However, this increase in capacity does not
solve all of the scalability issues that inundate Excel.
Imagine that you are working in a small company and you are using
Excel to analyze your daily transactions. As time goes on, you build a
robust process complete with all the formulas, pivot tables, and macros
you need to analyze the data that is stored in your neatly maintained work-
sheet.
As your data grows, you will first notice performance issues. Your
spreadsheet will become slow to load and then slow to calculate. Why will
this happen? It has to do with the way Excel handles memory. When an
Excel file is loaded, the entire file is loaded into RAM. Excel does this to
allow for quick data processing and access. The drawback to this behavior
is that each time something changes in your spreadsheet, Excel has to
reload the entire spreadsheet into RAM. The net result in a large spread-
sheet is that it takes a great deal of RAM to process even the smallest
change in your spreadsheet. Eventually, each action you take in your
gigantic worksheet will become an excruciating wait.
Your pivot tables will require bigger pivot caches, almost doubling your
Excel workbook’s file size. Eventually, your workbook will be too big to
distribute easily. You may even consider breaking down the workbook into
smaller workbooks (possibly one for each region). This causes you to
duplicate your work.
In time, you may eventually reach the 1,048,576-row limit of your work-
sheet. What happens then? Do you start a new worksheet? How do you
analyze two datasets on two different worksheets as one entity? Are your
formulas still good? Will you have to write new macros?
These are all issues that need to be dealt with.
05_104859 ch01.qxp 2/17/07 12:50 AM Page 5

Chapter 1 ■ The Case for Data Analysis in Access 5

Of course, you will have the Excel power-users, who will find various
clever ways to work around these limitations. In the end, however, they
will always be just workarounds. Eventually even these power-users will
begin to think less about the most effective way to perform and present
analysis of their data and more about how to make something fit into Excel
without breaking their formulas and functions. Excel is flexible enough
that a proficient user can make most things fit into Excel just fine. How-
ever, when users think only in terms of Excel, they are undoubtedly limit-
ing themselves, albeit in an incredibly functional way!
In addition, these capacity limitations often force Excel users to have the
data prepared for them. That is, someone else extracts large chunks of data
from a large database and then aggregates and shapes the data for use in
Excel. Should the serious analyst always be dependant on someone else for
his or her data needs? What if an analyst could be given the tools to access
vast quantities of data without being reliant on others to provide data?
Could that analyst be more valuable to the organization? Could that ana-
lyst focus on the accuracy of the analysis and the quality of the presenta-
tion instead of routing Excel data maintenance?
Access is an excellent, many would say logical, next step for the analyst
who faces an ever-increasing data pool. Since an Access table takes very
few performance hits with larger datasets and has no predetermined row
limitations, an analyst will be able to handle larger datasets without requir-
ing the data to be summarized or prepared to fit into Excel. Since many
tasks can be duplicated in both Excel and Access, an analyst who is profi-
cient at both will be prepared for any situation. The alternative is telling
everyone, “Sorry, it is not in Excel.”
Another important advantage of using Access is that if ever a process
that is currently being tracked in Excel becomes more crucial to the organi-
zation and needs to be tracked in a more enterprise-acceptable environ-
ment, it will be easier to upgrade and scale up if it is already in Access.

N OT E An Access table is limited to 256 columns but has no row limitation.


This is not to say that Access has unlimited data storage capabilities. Every bit
of data causes the Access database to grow in file size. An Access database has
a file size limitation of 2 gigabytes. In comparison, Excel 2007 has a limit of
1,048,576 rows and 16,384 columns regardless of file size.
05_104859 ch01.qxp 2/17/07 12:50 AM Page 6

6 Part I ■ Fundamentals of Data Analysis in Access

Transparency of Analytical Processes


One of Excel’s most attractive features is its flexibility. Each individual cell
can contain text, a number, a formula, or practically anything else the user
defines. Indeed, this is one of the fundamental reasons Excel is such an
effective tool for data analysis. Users can use named ranges, formulas, and
macros to create an intricate system of interlocking calculations, linked
cells, and formatted summaries that work together to create a final analysis.
So what is the problem with that? The problem is that there is no trans-
parency of analytical processes. Meaning it is extremely difficult to deter-
mine what is actually going on in a spreadsheet. Anyone who has had to
work with a spreadsheet created by someone else knows all too well the
frustration that comes with deciphering the various gyrations of calcula-
tions and links being used to perform some analysis. Small spreadsheets
that are performing modest analysis are painful to decipher, whereas large,
elaborate, multi-worksheet workbooks are virtually impossible to decode,
often leaving you to start from scratch.
Even auditing tools that are available with most Excel add-in packages
provide little relief. Figure 1-1 shows the results of a formula auditing tool
run on an actual workbook used by a real company. This is a list of all the
formulas in this workbook. The idea is to use this list to find and make
sense of existing formulas. Notice that line 2 shows that there are 156 for-
mulas. Yeah, this list helps a lot; good luck.

Figure 1-1: Formula auditing tools don’t help much in deciphering spreadsheets.
05_104859 ch01.qxp 2/17/07 12:50 AM Page 7

Chapter 1 ■ The Case for Data Analysis in Access 7

Compared to Excel, Access might seem rigid, strict, and unwavering in


its rules. No, you can’t put formulas directly into data fields. No, you can’t
link a data field to another table. To many users, Excel is the cool gym
teacher who enables you to do anything, whereas Access is the cantanker-
ous librarian who has nothing but error messages for you. However, all
this rigidity comes with a benefit.
Since only certain actions are allowable, you can more easily come to
understand what is being done with a set of data in Access. If a dataset is
being edited, a number is being calculated, or any portion of the dataset is
being affected as a part of an analytical process, you will readily see that
action. This is not to say that users can’t do foolish and confusing things in
Access. However, you definitely will not encounter hidden steps in an ana-
lytical process such as hidden formulas, hidden cells, or named ranges in
dead worksheets.

Separation of Data and Presentation


Data should be separate from presentation; you do not want the data to
become too tied into any one particular way of presenting it. For example,
when you receive an invoice from a company, you don’t assume that the
financial data on that invoice is the true source of your data. It is a presen-
tation of your data. It can be presented to you in other manners and styles
on charts or on web sites, but such representations are never the actual
source of the data. This sounds obvious, but it becomes an important dis-
tinction when you study an approach of using Access and Excel together
for data analysis.
What exactly does this concept have to do with Excel? People who per-
form data analysis with Excel, more often than not, tend to fuse the data,
the analysis, and the presentation together. For example, you will often see
an Excel Workbook that has 12 worksheets, each representing a month. On
each worksheet, data for that month is listed along with formulas, pivot
tables, and summaries. What happens when you are asked to provide a
summary by quarter? Do you add more formulas and worksheets to con-
solidate the data on each of the month worksheets? The fundamental prob-
lem in this scenario is that the worksheets actually represent data values
that are fused into the presentation of your analysis. The point being made
here is that data should not be tied to a particular presentation, no matter
how apparently logical or useful it may be. However, in Excel, it happens
all the time.
05_104859 ch01.qxp 2/17/07 12:50 AM Page 8

8 Part I ■ Fundamentals of Data Analysis in Access

In addition, as previously discussed, because all manners and phases of


analysis can be done directly within a spreadsheet, Excel cannot effectively
provide adequate transparency to the analysis. Each cell has the potential
of holding formulas, being hidden, and containing links to other cells. In
Excel, this blurs the line between analysis and data and makes it difficult to
determine exactly what is going on in a spreadsheet. Moreover, it takes a
great deal of effort in the way of manual maintenance to ensure that edits
and unforeseen changes don’t affect previous analyses.
Access inherently separates its analytical components into Tables,
Queries, and Reports. By separating these elements, Access makes data
less sensitive to changes and creates a data analysis environment where
you can easily respond to new requests for analysis without destroying
previous analyses.
Many who use Excel will find themselves manipulating its functionali-
ties to approximate this database behavior. If you find yourself in this situ-
ation, you must consider that if you are using Excel’s functionality to make
it behave like a database application, perhaps the real thing just might have
something to offer. Utilizing Access for data storage and analytical needs
would enhance overall data analysis and would allow the Excel power-
users to focus on the presentation in their spreadsheets.
In the future, there will be more data, not less. Likewise, there will be
more demand for complex data analysis, not less. Power-users are going to
need to add some tools to their repertoire in order to get away from being
simply spreadsheet mechanics. Excel can be stretched to do just about any-
thing, but maintaining such creative solutions can be a tedious manual
task. You can be sure that the sexy part of data analysis is not in routine
data management within Excel. Rather it is in the creating of slick
processes and utilities that will provide your clients with the best solution
for any situation.

Deciding Whether to Use Access or Excel


After such a critical view of Excel, it is important to say that the key to your
success in the sphere of data analysis will not come from discarding Excel
altogether and exclusively using Access. Your success will come from pro-
ficiency with both applications and the ability to evaluate a project and
determine the best platform to use for your analytical needs. Are there
hard-and-fast rules that you can follow to make this determination? The
answer is no, but there are some key indicators in every project that you
can consider as guidelines to determine whether to use Access or Excel.
These indicators are the size of the data, the data’s structure, the potential
05_104859 ch01.qxp 2/17/07 12:50 AM Page 9

Chapter 1 ■ The Case for Data Analysis in Access 9

for data evolution, the functional complexity of the analysis, and the
potential for shared processing.

Size of Data
The size of your dataset is the most obvious consideration you will have to
take into account. Although Excel can handle more data than in previous
versions, it is generally a good rule to start considering Access if your
dataset begins to approach 100,000 rows. The reason for this is the funda-
mental way Access and Excel handle data.
When you open an Excel file, the entire file is loaded into RAM to ensure
quick data processing and access. The drawback to this behavior is that
Excel requires a great deal of RAM to process even the smallest change in
your spreadsheet. You may have noticed that when you try to perform an
AutoFilter on a large formula-intensive dataset, Excel is slow to respond,
giving you a Calculating indicator in the status bar. The larger your dataset
is, the less efficient the data crunching in Excel will be.
Access on the other hand does not follow the same behavior as Excel.
When you open an Access table, it may seem as though the whole table is
opening for you, but in reality Access is storing only a portion of data into
RAM at a time. This ensures the cost-effective use of memory and allows
for more efficient data crunching on larger datasets. In addition, Access
allows you to make use of Indexes that enable you to search, sort, filter, and
query extremely large datasets very quickly.

Data Structure
If you are analyzing data that resides in a table that has no relationships
with other tables, Excel is a fine choice for your analytical needs. However,
if you have a series of tables that interact with each other, such as a Cus-
tomers table, an Orders table, and an Invoices table, you should consider
using Access. Access is a relational database, which means it is designed to
handle the intricacies of interacting datasets. Some of these are the preser-
vation of data integrity, the prevention of redundancy, and the efficient
comparison and querying of data between the datasets. You will learn
more about the concept of table relationships in Chapter 2.

Data Evolution
Excel is an ideal choice for quickly analyzing data that is being used as a
means to an end, such as a temporary dataset that is being crunched to
05_104859 ch01.qxp 2/17/07 12:50 AM Page 10

10 Part I ■ Fundamentals of Data Analysis in Access

obtain a more valuable subset of data. The result of a pivot table is a perfect
example of this kind of one-time data crunching. However, if you are
building a long-term analytical process with data that has the potential of
evolving and growing, Access is a better choice. Many analytical processes
that start in Excel begin small and run fine, but as time passes these
processes grow in both size and complexity until they reach the limits of
Excel’s capabilities. The message here is that you should use some fore-
sight and consider future needs when determining which platform is best
for your scenario.

Functional Complexity
There are far too many real-life examples of analytical projects where
processes are brute forced into Excel even when its limitations have been
reached. How many times have you seen a workbook that contains an ana-
lytical process encapsulating multiple worksheets, macros, pivot tables,
and formulas that add, average, count, look up, and link to other work-
books? The fact is that when Excel-based analytical processes become
overly complex, they are difficult to manage, difficult to maintain, and dif-
ficult to translate to others. Consider using Access for projects that have
complex, multiple-step analytical processes.

Shared Processing
Although it is possible to have multiple users work on one central Excel
spreadsheet located on a network, ask anyone who has tried to coordinate
and manage a central spreadsheet how difficult and restrictive it is. Data
conflicts, loss of data, locked out users, and poor data integrity are just a
few examples of some of the problems you will encounter if you try to
build a multiple user process with Excel. Consider using Access for your
shared processes. Access is better suited for a shared environment for
many reasons, some of which are: the ability for users to concurrently enter
and update data, inherent protection against data conflicts, prevention of
data redundancy, and protection against data entry errors.

An Excel User’s Guide to Access: Don’t Panic!


Many seasoned managers, accountants, and analysts at some point come
to realize that just because something can be done in Excel that does not
necessarily mean Excel is the best way to do it. This is the point when they
decide to open Access for the first time. When they do open Access, the first
05_104859 ch01.qxp 2/17/07 12:50 AM Page 11

Chapter 1 ■ The Case for Data Analysis in Access 11

object that looks familiar to them is the Access table. In fact, Access tables
look so similar to an Excel spreadsheet that most Excel users try to use
tables just like a spreadsheet. However, when they realize that they can’t
type formulas directly into the table or duplicate most of the behavior and
functionality of Excel, most of them wonder just what exactly the point of
using Access is.
When many Excel experts find out that Access does not behave or look
like Excel, they write Access off as being too difficult or taking to much
time to learn. However, the reality is that many of the concepts behind how
data is stored and managed in Access are concepts with which the user is
already familiar. Any Excel user has already learned such concepts in order
to perform and present complex analysis. Investing a little time up front to
see just how Access can be made to work for you can save a great deal of
time later in automating routine data processes.
Throughout this book, you will learn various techniques in which you
can use Access to perform much of the data analysis you are now perform-
ing exclusively in Excel. This section is a brief introduction to Access from
an Excel expert’s point of view. Here, you will focus on the big-picture
items in Access. If some of the Access terms mentioned here are new or not
terribly familiar, be patient. They will be covered more in depth as the book
progresses.

Tables
What will undoubtedly look most familiar to you are Access tables. Tables
appear almost identical to spreadsheets with the familiar cells, rows, and
columns. However, the first time you attempt to type a formula in one of
the cells, you will see that Access tables do not possess Excel’s flexible,
multi-purpose nature that allows any cell to take on almost any responsi-
bility or function.
The Access table is simply a place to store data, such as numbers and
text. All of the analysis and number crunching happens somewhere else.
This way, data will never be tied to any particular analysis or presentation.
The data is in its raw form, leaving it up to users to determine how they
want to analyze or display it. If an Excel user only uses Access tables, that
user can still immensely increase his or her effectiveness and productivity.

Queries
You may have heard of Access queries but have never been able to relate to
them.
05_104859 ch01.qxp 2/17/07 12:50 AM Page 12

12 Part I ■ Fundamentals of Data Analysis in Access

Consider this: In Excel, when you use AutoFilter, a VLookup formula, or


Subtotals, you are essentially running a query. So what is a query? A query
is a question you pose against your data in order to get an answer or a
result. The answer to a query can be a single data item, a Yes/No answer,
or many rows of data. In Excel, the concept of querying data is a bit nebu-
lous as it can take the form of the different functionalities, such as formu-
las, AutoFilters, and PivotTables.
In Access, a query is an actual object that has its own functionalities. A
query is separate from a table in order to ensure that data is never tied to
any particular analysis. You will cover queries extensively in subsequent
chapters. Your success in using Microsoft Access to enhance your data
analysis will depend on your ability to create all manners of both simple
and complex queries.

Reports
Access reports are an incredibly powerful component of Microsoft Access
that allows data to be presented in a variety of styles. Access reports, in and
of themselves, provide an excellent illustration of one of the main points of
this book: data should be separate from the analysis and presentation. The
report serves as the presentation layer for a database, displaying various
views into the data within. Acting as the presentation layer for your data-
base, reports are inherently disconnected from the way your data is stored
and structured. As long as the report receives the data it requires in order
to accurately and cleanly present its information, it will not care where the
information came from.
Access reports can have mixed reputations. On the one hand, they can
provide clean-looking PDF-esque reports that are ideal for invoices and
form letters. On the other hand, Access reports are not ideal for showing
the one-shot displays of data that Excel can provide. However, Access
reports can easily be configured to prepare all manners of report styles,
such as crosstabs, matrices, tabular layouts, and subtotaled layouts.

Macros and VBA


Just as Excel has macro and VBA functionality, Microsoft Access has its
equivalents. This is where the true power and flexibility of Microsoft
Access data analysis resides. Whether you are using them in custom func-
tions, batch analysis, or automation, macros and VBA can add a cus-
tomized flexibility that is hard to match using any other means. For
example, you can use macros and VBA to automatically perform redun-
05_104859 ch01.qxp 2/17/07 12:50 AM Page 13

Chapter 1 ■ The Case for Data Analysis in Access 13

dant analyses and recurring analytical processes, leaving you free to work
on other tasks. Macros and VBA also enable you to reduce the chance of
human error and to ensure that analyses are preformed the same way
every time. Starting in Chapter 11, you will explore the benefits of macros
and VBA and how you can use them to schedule and run batch analysis.

Summary
Although Excel is considered the premier tool for data analysis, Excel has
some inherent characteristics that often lead to issues revolving around
scalability, transparency of analytic processes, and confusion between data
and presentation. Access has a suite of analytical tools that can help you
avoid many of the issues that arise from Excel.
First, Access can handle very large datasets and has no predetermined
row limitation. This allows for the management and analysis of large
datasets without the scalability issues that plague Excel. Access also forces
transparency of the separation of data and presentation by separating data
into functional objects (such as tables, queries, and reports) and by apply-
ing stringent rules that protect against bad processes and poor habits.
As you continue through this book, it is important to remember that
your goal is not to avoid Excel altogether. Your goal is to broaden your
toolset and to understand that Access often offers functionality that both
enhances your analytical processes and makes your life easier.
05_104859 ch01.qxp 2/17/07 12:50 AM Page 14
06_104859 ch02.qxp 2/17/07 12:50 AM Page 15

CHAPTER

Access Basics

When working with Access for the first time, it is tempting to start filling
tables right away and querying data to get fast results, but it’s important to
understand the basics of the relational database concept before pounding
away at data. A good understanding of how a relational database works
will help you take full advantage of Access as a powerful data analysis
solution. This chapter covers the fundamentals of Access and methods to
bring data into the program.

Access Tables
Upon opening Access, you notice that the Database window, shown in Fig-
ure 2-1, contains a task pane on the left. Using the topmost drop-down box,
change the navigation category to All Access Objects. You will get six sec-
tions. Each section represents one of the six database objects: Tables,
Queries, Forms, Reports, Macros, and Modules. The Tables selection is
appropriately at the top of the list, because it is the precise location where
your data will be stored. All other database objects will refer to the tables in
your database for data, whether asking questions of the data or creating
reports based on the data. This section covers the basics to get you working
with Access tables.

15
06_104859 ch02.qxp 2/17/07 12:50 AM Page 16

16 Part I ■ Fundamentals of Data Analysis in Access

Figure 2-1: The navigation pane on the left enables you to navigate through the six types
of database objects: Tables, Queries, Forms, Reports, Macros, and Modules.

Table Basics
One way to think of a table is as a collection of data concerning a specific
type of entity (such as customers, branches, transactions, products, and so
on). You want each of these entities to have its own unique table. Among
the many advantages to storing your data using this approach is eliminat-
ing or significantly decreasing duplicate information. Later in the chapter,
you will learn about the dangers inherent in storing data with excessive
duplications.

Opening a Table in the Datasheet View


Open your sample database and go to the Tables section in the navigation
pane. Double-click the CustomerMaster table. When the table opens, it is in
the Datasheet view. In this view, you are able to directly view and edit the
contents of the table. As you can see in Figure 2-2, the names of the
columns are at the top.
06_104859 ch02.qxp 2/17/07 12:50 AM Page 17

Chapter 2 ■ Access Basics 17

Figure 2-2: Opening the table in Datasheet view will allow you to view and edit the data
stored in the table.

Identifying Important Table Elements


The table is comprised of rows, with each row representing a single
instance of the table name or entity. In CustomerMaster, each row repre-
sents a single distinct customer with which the firm does business. The
proper database terminology for a row is record.
The table is also comprised of columns, with each column representing a
particular piece of information common to all instances of the table’s entity.
In CustomerMaster, each column represents some attribute of the customer
that you want to record. The proper database terminology for a column is
field.

T I P The number of records in a table is visible at the bottom left of the


Datasheet view, next to the record selectors.

Opening a Table in the Design View


Through the Design view of a table, you are able to set the field names and
data types. To get to the Design view of the CustomerMaster table, go to
the Home tab and select View → Design View as demonstrated in Figure
2-3.
06_104859 ch02.qxp 2/17/07 12:50 AM Page 18

18 Part I ■ Fundamentals of Data Analysis in Access

Figure 2-3: Opening the CustomerMaster table in the Design view.

As you can see in Figure 2-4, the Design view shows you the fields that
comprise the CustomerMaster table in an easy-to-manage view.
Note how each field has a Field Name and a Data Type. The Field Name
is the descriptive text string given to that particular column of a table. It is
what appears at the top of the table when it is in the Datasheet view. The
Data Type of the field ensures that only a certain type of data is allowed in
the field. If a data type is tagged as a Number, Access does not enable you
to enter any text into that field. By setting the data type of each column,
you go a long way to ensuring the integrity and consistency of the data.

Figure 2-4: Opening the table in the Design view enables you to add field names or change
existing ones.
06_104859 ch02.qxp 2/17/07 12:50 AM Page 19

Chapter 2 ■ Access Basics 19

T I P It’s good practice not to put any spaces in your field names. When
constructing queries or referring to tables in VBA code, spaces in the field names
can lead to problems. If you need to indicate a space in your field name, use the
underscore character (_). Keep in mind that your field names cannot include a
period (.), an exclamation point (!), an accent grave (`), or brackets ([ ]).

Exploring Data Types


The concept of the data type is crucial not only to understanding Access,
but also to unlocking the power of the programming language behind
Access, VBA. Quite simply, computers process and store data, and that
data is categorized by its type.
With the Design view of the CustomerMaster table open, select the Data
type section of the first field and click the drop-down arrow. A list of pre-
defined data type choices becomes visible. These data types are: Text,
Memo, Number, Date/Time, Currency, AutoNumber, Yes/No, OLE
Object, Hyperlink, and Attachment.

N OT E When in Design View, you will also see a data type selection called
Lookup Wizard. This selection is actually not a data type at all. It’s actually a
mechanism used to activate the Lookup Wizard in order to create lookup fields.
The Lookup Wizard is not within the scope of this book.

■■ Text: Any combination of letters, numbers, spaces, and characters is


text. This is by far the most common data type. Although text can be
a number, it should not be a number used in a calculation. Examples
of common uses of the Text data type are customer names, customer
numbers (using customer numbers in calculations would have no
meaning), and addresses. The maximum number of characters
allowed in a Text field is 255 characters.
■■ Memo: If you need to store text data that exceeds the 255-character
limit of the Text field, the Memo field should be used. Long descrip-
tions or notes about the record can be stored in fields of this type.
■■ Number: This type is for all numerical data that will be used in cal-
culations, except currency (which has its own data type). Actually,
Number is several data types under one heading. When you select
Number as a data type in the Design view of the table, you go to the
Field Size field at the top of the General tab. When you select the
drop-down arrow, you get the following options: Byte, Integer, Long
Exploring the Variety of Random
Documents with Different Content
again in twelve hours. That is why this bustle and noise must go on
until the very moment when the curtain rises."
He descended the steps slowly and cautiously, as if everything
were again swimming before him.
"Shall I go back and get you a glass of Seltzer-water?" she
asked, as she stood in the door-way; "or would it not be better to
send for the doctor?"
"No, thank you, Kitty," he replied, in a strangely gentle tone,
and his moistened glance rested lingeringly upon the girl who had
expressed such kind anxiety, "And indeed you are mistaken if you
think Bruck is to be had so easily. He is overwhelmed with practice; I
believe he will have to be sent for to leave some sick-bed to come to
his very marriage, the day after to-morrow." A sarcastic smile flitted
across his face. "My best remedy is, I know," he instantly added,
"my vaults in the tower. I am just going there to select the wine for
this evening; the air in those cellars will act like a cooling bandage."
Kitty arranged her hat upon her head and came out upon the
door-steps.
"And you are going to the mill? No farther, I hope?" he said,
looking at his watch. It was a simple question, and negligently
uttered, and yet it seemed to Kitty that he caught his breath as he
asked it.
Descending the steps, she told him her errand to the mill, and
then, nodding a farewell, she crossed the road while the councillor
turned towards the tower. Behind the first group of shrubs, she
turned and looked after him; he was surely suffering more than he
would admit. His knees seemed to tremble beneath him; he had
thrust back the hat from his forehead as if his brow were burning,
and his eyes were wandering aimlessly over the park.
Suddenly her temples throbbed; a vague terror assailed her.
That sick man tottering so uncertainly alone in the tower-cellar! Like
some fever-bred phantom, the horrible thought that had shocked
her once before in sight of the tower again occurred to her. "I pray
you, Moritz, be careful with the light," she cried anxiously after him.
He might have been deep in thought, or perhaps his nerves
were in that unusually irritable state when a loud voice sufficed to
terrify; he started as if struck by a shot.
"What do you mean by that?" he called back, hoarsely. "Are you
seeing ghosts by daylight, Kitty?" he instantly added, with a burst of
laughter that mortified his ward, as he vanished among the trees,
waving his hand and holding himself erect.
Scarcely half an hour later, Kitty was walking along the river-
bank. Her errand to the mill accomplished, she found she had time
to snatch one sweet, stolen glance at the house by the river. How
her heart beat as she saw the weather-cock on the roof gleaming in
the sunlight through the quivering birch-leaves! How she started at
the crunching of the gravel on the path beneath her tread! She came
like an exile to have one last look of a beloved country. She leaned
against the trunk of the poplar that stood by the bridge, whence she
had stamped that last scene so ineffaceably on her memory,—the
peeping children, their heads showing against the brilliant landscape
beyond as upon a golden background, the strong stern man by the
garden-table seeming crushed by some inexplicable emotion.
All was quiet now in the shaded garden. The trees, then in all
the pride of spring, were now bending with the load of bright-
coloured fruit that filled the air with its fragrance, and the trellis was
hardly seen beneath its purple load. Only one shy glimpse towards
the corner window, where stood the doctor's writing-table. He was
not at home; he was hastening from one bedside to another, driven
by professional cares. And he no longer occupied that room. White
muslin curtains adorned the window; upon the sill, among the pots
of Alpine violets in full bloom, lay a snow-white kitten, and two
knitting hands and a woman's head crowned with snowy hair
beneath a muslin fichu could be distinguished there; the Frau Dean's
old friend was already established. He too had burned his ships
behind him; he was ready to go, and the day after the morrow, the
"last moment" would come, when her proud, heartless sister would
stand beside him in glistening white satin, to become mistress of the
mansion to a man of note. Had she once struggled as bitterly—that
fair young dame of by-gone days—as did the girl who now, in a
burst of tears, clasped her arms about the poplar's slender stem and
pressed her brow painfully against the rough, hard bark? She of the
legend had once been loved, if deserted at last; no blame could be
attached to her; but here an evil jealousy was gnawing at the heart
of one unloved, and she whom she envied was—her own sister.
A loud footfall behind her made her look around. Franz the
miller, with an iron crowbar over his shoulder, was passing by, to
look after the upper weir, he said. His presence sent the blood to her
cheeks and scared her from her post of observation. While Franz
hurried on she walked slowly along the bank of the stream. She
could not yet make up her mind to return to the villa; her toilette for
the evening would be completed long before Henriette, who was
determined to be present at the fête, had half finished the
adornments which were to make the ravages of disease less
conspicuous.
The solitude here was so delicious; there was no one to see
how red her eyes were, or how angrily her wayward heart was
battling with the sinful desires that had urged her hither,—yes, they
had been the cause of her coming. She would not spare herself or
lie to her own soul! She had not come to see the quiet house, and
the dear old friend whose home it was, and she had not been sure
that he was not there. She had hoped—what? And when another
face than his had appeared at the window the whole place had been
to her lonely and deserted.
Franz had vanished in the distance. She was approaching the
ruin. The circle of water about it glistened, and through the
shrubbery she could see the graceful bridge spanning the ditch. At
the moment a man was crossing it from the tower. A thick reddish
beard covered the lower part of his face; he wore a labourer's
blouse, and was driving two roes before him with his stick. They
leaped across the bridge and fled into the recesses of the park.
Kitty would have paid the man no especial attention—workmen
were continually employed in and about the tower—if his conduct
had not seemed strange to her. The councillor was very fond of
these roes; he was provoked when they strayed into the park, and
here this stranger was intentionally chasing them across the ditch!
Was he one of the discontented crowd of factory-hands who envied
the rich man and wrought mischief to his possessions whenever they
could? He turned into a path leading through the park-gates out
upon the high-road; she followed him with her eyes until he was lost
in the thicket. The resemblance was wonderful! In his carriage and
height, in his whole make, indeed, the man in the blouse might have
been the councillor's twin brother.
She stood involuntarily rooted to the spot, looking towards the
tower whence he had come. How charmingly the landscape here
harmonized with the structure! How well the modern architect had
known how to spare and now to efface so as to weave about the old
ruin a romantic charm!
Silence reigned again; no sound was heard but the faint
flapping of the doves' wings; those graceful sailors of the air were
floating in the crimson evening light, slipping through the interstices
of the mural crown of the tower as it showed clear against the
western sky—No, it was no mural crown! in a flash it was a burning
crater, vomiting forth with a noise like thunder a cloud of pitchy
vapour into the serene skies. The ground seemed to be torn from
beneath the girl's feet. She was dashed to the earth and in an
instant immersed in the cool waters of the fosse.

What was it? Every one came running from the villa to take refuge in
the garden. The house tottered from foundation to roof-tree. An
earthquake? As if bereft of all sense, the members of the household
stood still in the open air as though expecting to see the earth yawn
at their feet. Little rills of water were trickling through the grass of
the lawn. The air began to be filled with smoke, and to scatter
everywhere on the gravel walks particles of burned material. The
panes of plate-glass in the windows were broken; and in the ball-
room the huge mirror stretching from floor to ceiling lay shattered
into a thousand pieces, the silk and velvet draperies had dropped
from their fastenings around the stage, and the workmen had with
difficulty escaped injury from the falling framework.
Passers-by rushed in from the road, among them Anton, who
was just returning from town. "There! there!" they cried to the Frau
President, who was leaning half fainting upon Flora's arm, and as
they spoke they pointed to the distant portion of the park. There
was a fire in that direction, and huge volumes of smoke were
pouring upwards so thickly that the sparks showed in its pitchy
blackness like rockets in a dark night.
"The powder in the tower has exploded!" a voice cried from the
midst of the throng.
"Nonsense!" Anton replied, with an attempt at a laugh, although
his teeth were chattering in his head with terror. "That old stuff has
long been past exploding, and the few pinches of fresh which the
Herr Councillor had stored there in jest could not have stirred a tile
from its place."
Nevertheless he ran wildly in the direction of the tower across
the flooded lawn,—he knew his master had gone thither. The crowd
followed him, whilst the fire-alarm from the neighbouring town
began to toll.
What had become, in a moment almost too brief to suffice for
one human breath, of the Eden which wealth and luxury had evoked
from the ruins of knightly splendour? When the black vapour
darkened the heavens there had burst into air the infernal force as if
from some subterranean fountain; huge masses of granite had been
tossed forth to lie here and there half buried in the soft sod of the
lawn, having broken strong trees like reeds in their descent, while
towards the south the new conservatory stood like a sieve of glass,
each splinter sparkling and gleaming in the evening light. There
must have been a perfect hailstorm of stones poured upon it, thus to
shatter the exquisite toy, so lately the admiration of the capital.
It was indeed a sight to horrify the breathless crowd as they
emerged from the shrubbery that had partially concealed the extent
of the disaster. Had the ghostly ancestress of the Baumgartens
indeed lighted the train to put an end to the farce which the modern
parvenu was playing above the hoary ruins of the home of her race?
Those builders of old must have cemented their walls with iron. The
upper portion of the tower, with its machicolated summit, was
indeed scattered to all the four winds of heaven, but of the lower
and more ancient building only the smaller part had been destroyed;
it lay in huge masses near the fosse, whilst the rest still stood
threateningly erect in air, and from its depths the yellow flames
ascended, greedily devouring every particle of wood or inflammable
material within.
"My poor master!" Anton groaned, stretching his arms in despair
across the ditch, the waters of which had been raised from their bed
by the force of the explosion to flow here and there over the park.
They were now pouring back again, and dashing once more upon
their accustomed way, carrying with them gravel, grass, and the
bleeding bodies of slain doves and rooks. The pretty arches of the
bridge had vanished, the green artificial hill was seamed by huge
rifts, and the old chestnuts which it had nourished were thrust forth
from its bosom to lie stretched on the ground, their boughs
interlaced like the horns of deer dead in mortal conflict.
Of what use were the crowds of men hurrying hither with their
fire-engines? There was nothing to save. Where in that glowing
crater could be found the costly furniture, the famous collection of
ancient tankards, the pictures, statuary, ivory carvings, and rich
carpets? As if in ghastly mockery, a crimson silk curtain that had
floated uninjured from one of the windows was still hanging from a
fragment of stone sill down over the remains of the outer wall, like a
stream of blood flowing from some terrible wound.
And among the crowd there ran whispers of the piles of gold
and silver—or no, papers, bundles of papers, representing
incalculable sums, factories, mines, landed property,—all of which
the old tower, with its mighty walls, its impregnable locks, and its
fosse, had guarded like a dragon. Where were they now? Where
were the sheets of iron that had imprisoned them? Had the safes
fallen undestroyed into the vaults of the cellar, to await there a
future resurrection in defiance of the flames?
And what had become of him,—of the man who, as Anton
declared, had gone to the tower an hour before to select the wine
for the evening's entertainment? All gazed helplessly at the flaming
mass, while the faithful servant ran to and fro on the bank of the
ditch, wringing his hands, and shouting his master's name across the
water. It had been inconceivable folly to keep the powder there
where an unguarded lamp was so frequently used.
"The old historic powder has had nothing to do with this. Some
very different explosive material has been at work here," a loud
voice said from the crowd. The speaker was an engineer, and had
been passing by the villa at the moment of the catastrophe.
"But how came anything else in the cellar?" Anton stammered,
standing still, and looking at the speaker with wonder and inquiry.
The man shrugged his shoulders with a meaning look, and,
turning, was lost in the crowd, whilst the engines did their work.
As long as the fire raged, the jets of water hissed upon the
flames, the alarm-bell tolled unceasingly, firemen brought planks and
poles from the villa to construct some kind of a bridge over the
fosse, and the noise and confusion increased from moment to
moment. In the midst of it all, a piercing shriek was heard at some
distance; on the path leading to the upper weir Franz the miller had
been found; a heavy stone had prostrated him and crushed in his
chest; the man was dead.
This shriek, uttered by his wife as she threw herself upon the
body, seemed re-echoed from all parts of the park it was so
resounded with cries from hundreds of throats.
"Moritz,—they have found him!" the Frau President murmured,
with a start. She had sunk down upon a garden-seat not far from
the house,—her feet refused to carry her farther. She now made an
effort to rise; in vain! The infirmity of age, hitherto so resolutely
ignored, asserted itself at this moment of nervous agitation. "Have
they found him? Is he dead? Dead?" she stammered, incoherently,
her eyes, usually so coldly calm, staring wildly in the direction of the
ruin, whilst she clutched the arm of Flora, who was standing beside
her.
The beautiful woman alone preserved her composure. There
above the trees the thick vapour rolled lazily and heavily upwards,
painting the heavens far and near in dull ashen gray, and here
before the house, with its shattered window-panes, the orange-trees
were overturned upon the lawn, where the water trickled and flowed
in little rills, to gather in pools in the deep furrows cut by the fire-
engines. The air was filled with wild outcries, crowds of people were
rushing past each moment from the town, and in the midst of this
desolation stood a lovely woman, clad in white, with marguerites on
her breast and in her fair curls, pale to the lips, but collected and
self-assured in her demeanor,—a being set apart from all personal
misfortune.
"If you would only loosen your hold of my arm, grandmamma,"
she said, impatiently, "I might possibly convince you that you are
needlessly alarmed. Why must Moritz have perished? Pshaw! Moritz,
with his constant good fortune! I am perfectly sure that he is there
in the midst of the crowd, safe and sound, and those stupid
servants, who, by the way, pay us no attention, except to shout out
some unintelligible nonsense in passing, are so frightened that they
do not know their own master when they see him." She looked
down at the wet sod, and then at her white boot that peeped forth
from beneath the flounces of her muslin dress. "One would say I too
had lost my senses," she continued, with a shrug, "but I must go
and see——"
"No, no, you must stay here!" cried the Frau President, grasping
the skirt of white muslin. "You will not leave me alone with
Henriette, who is still more helpless than I, and is of no use to me?
Oh, God, I shall die! If he should be dead, if—what then?" Her head
sank upon her breast, that gleamed with diamonds; she looked old
and infirm, and her form seemed bent and shrunken in the stiff folds
of her yellow moiré dress.
Henriette crouched upon the seat beside her, ashy pale, with
wide, terrified eyes. "Kitty! Where can Kitty be?" she repeated to
herself with trembling lips, as if it were a sentence she were learning
by rote.
"God in heaven grant me patience!" Flora muttered between her
teeth. "Such weakness is terrible. Why in the world, Henriette, are
you continually asking for Kitty? No one means to take her from
you!"
She looked impatiently towards the house, but no one was to be
seen who could relieve her of her charge; every one had gone to the
ruins,—the newly-arrived guests, the footmen, the servants from the
kitchen; even the neatly-shod ladies' maids had run through the wet
towards the scene of the disaster. But aid approached from town in
the persons of the amateur performers, who came breathlessly
round the corner of the house.
"For heaven's sake, tell us what is the matter!" cried Fräulein
von Giese, rushing up to the lonely group of women.
Flora shrugged her shoulders. "We know nothing more than that
there has been an explosion in the tower. Every one runs past us; no
one answers our questions; and I cannot stir from the spot, because
grandmamma has lost her head, and in her agitation is positively
tearing the clothes off my back. She imagines that Moritz is killed."
The young girls stood as if turned to stone at this horrible idea,
—the strong, handsome man who only a few hours before had
emptied his glass to the "delights of life" already perished in the
flames or crushed to atoms! It could not be. "Impossible!" exclaimed
Fräulein von Giese.
"Impossible?" the Frau President repeated, with a mingling of
sobs and wild laughter: she had struggled to her feet, but she
tottered like a drunken man as she pointed a trembling finger
towards the nearest grove. "There—they are bringing him! My God!
Moritz, Moritz!"
In solemn silence an object was being borne along, and within
the circle of those who were accompanying it walked Doctor Bruck,
without his hat, his tall figure towering above the rest. Flora flew
towards him, whilst the Frau President burst into a fit of convulsive
weeping. At sight of the lovely commanding figure the group
involuntarily parted. Flora gave one hasty glance at the form
extended upon a litter, and instantly turned back to say soothingly,
"Be calm, grandmamma! It is not Moritz——
"It is Kitty,—I knew it," Henriette murmured hoarsely, in a voice
that was half sob, half whisper, as she staggered across to where the
bearers had put down their burden for a minute to take breath.
The poor girl lay upon the old-fashioned couch from the doctor's
study. Her dress hanging over its side was dripping with moisture.
Soft pillows were beneath her back and head; with her eyelids so
gently closed and her hands resting so calmly upon her breast, one
might have imagined her sleeping, but for the bandage above her
brow and the blood trickling down her cheek.
"What has happened to Kitty, Leo? What was she doing near the
ruin?" Flora asked, approaching the couch, both in tone and in
manner displaying more irritation at her sister's supposed
forwardness than terror at what had happened.
At her previous remark, intended to soothe her grandmother,
the doctor had turned in sudden anger; now he seemed not to hear
her speaking, so firmly closed were his lips, so stolid was the look
which passed her by to rest with interest upon Henriette.
The poor invalid stood before him gasping for breath, looking up
to him with eyes dimmed with tears. "Only one word, Leo; is she
alive?" she stammered, raising her hands clasped in entreaty.
"Yes; the concussion and loss of blood have stunned her; the
only danger at present to be apprehended is from her wet clothes.
The wound on her temple is trifling, thank God!" he answered in
vibrating tones, which seemed to come from the depths of his heart,
while with all a brother's tenderness he put his left arm around the
frail form that could hardly stand upright. "Go on," he said to the
bearers, with evident anxiety and impatience.
The accompanying crowd dispersed; there was no danger here,
and most of them returned to the ruin. The couch was carried on
towards the house, past the Frau President, who gazed at the
unconscious form as if bereft of all capacity to understand and
appreciate. The group of horrified girls stood huddled together,
looking helplessly towards the young physician who walked beside
the couch without noticing them. He kept his left arm around
Henriette's waist; his right hand he had laid lightly upon Kitty's brow,
as if to shield her from any shock if consciousness should return. He
who was usually so reserved, who so carefully concealed all
emotion, the man whom of late all had seen so gloomy and
constrained, was now looking down with unconcealed tenderness
upon the pale face lying upon the pillows, as if nothing existed for
him in the world except this most sacred and dear treasure which he
had just snatched from the grave.
Flora followed the silent group apart, as if bound by no tie to
the three people whom misfortune had suddenly shown to be so
closely allied. On the spot where the bearers had rested the water
was standing in little pools; she walked through them not heeding
the wet, and her long muslin train dragged damp and dirty over the
gravelled path. Suddenly she tore the wreath of marguerites from
her hair; it was a bitter mockery in the midst of all this horror; she
plucked and pulled it to pieces mechanically as she walked along,
and the little white stars lay scattered upon the ground over which
she had passed.
She too passed her grandmother and her friends without
heeding them. Her flashing glance rested immovably upon her
lover's tall, commanding figure; evidently she momentarily expected
that he would turn to her, and thus she followed him step by step to
the house and across its threshold. The Frau President called after
her; the earth was shaken by another loud crash from the ruins,
followed by shouts and cries. She did not look round; the world
might be dissolved behind her; she was inexorably resolved to assert
her "rights."
CHAPTER XXV.

A silent night of anxious, breathless suspense ensued upon this


horrible day. No one went to bed; the gas was lighted all over the
house, the servants glided noiselessly about on tiptoe, or huddled
whispering in corners, and when some fireman passed near the
house, or a door was softly opened, all started as from an electric
shock and hurried into the corridors, sure that some intelligence
would be brought of the master of the house. But the night waned,
and the dawn peeped in at the windows,—he never, never came.
The rosy light of a glorious morning shone upon Villa
Baumgarten, making the broken window-panes glitter and shine. It
entered the ball-room and kindled the crimson of the fallen canopy,
it kissed the fading leaves of the festoons of green and the broken
boughs of the plants brought from the conservatory;—what chaos
reigned there! One single minute had converted the costly but frail
"Arabian Nights' Entertainment" into a heap of ruins and fragments.
The charming verses in praise of the bride were unspoken, and upon
the spot where the bespangled genius should have hovered in a rosy
cloud, the keen morning breeze toyed mockingly with shreds of pink
and white tulle.
It was the first time, perhaps, that the light of dawn had seen
these splendid interiors; no shutter had been closed, no shade
drawn down,—it even stared in upon the gorgeous bedroom in the
northeastern angle of the building, upon the violet silk draperies, the
richly-carved bedstead covered with lace, and it might mirror itself in
the diamonds strewn among the puffs of the Frau President's hair.
The maid had not dared to offer her services to the old lady, who
now and then would totter through the long suite of apartments,
dragging after her her heavy yellow train among overturned
furniture and statues toppled from their pedestals.
The cloud of tulle which she always wore about her neck and
chin had become loosened, and the sharp, withered outline of the
lower portion of her face and of the throat was painfully evident.
Yes, she was very old, and the sun of her life was low on the
horizon; nevertheless, her aged brain was busy with but one
absorbing thought, "Who is Moritz's heir?" She herself had not the
slightest claim upon the wealth of the man so suddenly snatched
away, not even upon the bed in which she slept or the plate from
which she ate. The councillor had been early left an orphan; so far
as she knew, he had no existing relatives of his name; but had he
not continually sent a subsistence to a sister of his mother's living on
the Rhine? Would she inherit his wealth? The idea was maddening.
The wife of an obscure clerk, a needy seamstress, would then take
possession of this colossal fortune, and the Frau President Urach,
who for years had not been able to conceive how any one could
move without silken-cushioned equipages, how any one could dine
without lackeys in waiting, or sleep unless in a bed canopied with
silk, would have to rout out her old furniture from the garrets
whither it had been banished, and hire narrow lodgings where there
were no stables filled with horses, no liveried servants and princely
ménage, for neither she nor her granddaughters were connected by
any tie of blood with the millionaire who had gone out of the world
intestate.
The guests invited from the neighbourhood had remained with
the old lady until midnight, and, although no distinct mention had
been made of this subject, there had not been lacking allusions to
the business complications that must ensue upon the catastrophe,
since the councillor had kept all his ledgers and business papers of
every description in the tower, and not a scrap of them was to be
found.
But, although enormous sums had thus been destroyed, did not
she, the Frau President, at present make her home upon an estate
valued at many thousands? Were not the vaults of the plate-
chamber beneath her feet? Were not the stables full of thorough-
bred horses? And was not the collection of paintings of incalculable
value? All this would more than suffice to ensure a luxurious
existence to the old lady to the end of her days, if only she could
prove that one drop of blood in her aristocratic veins came from the
same source that had given life to the rope-maker's son.
And they spoke also of her who lay at present above-stairs, in
Henriette's sitting-room, the castle miller's granddaughter; they
knew that her entire fortune had been kept in the tower. Upon this
theme the Frau President in her nervous agitation did not care to
speculate; what was the old miller's hoarded wealth to her? Flora, on
the contrary, maintaining an entire self-possession in spite of the
horrors of the day, pondered long upon the possible consequences
to her half-sister of the destruction of the safe in the tower.
There was an angry frown upon her brow as she came down
from the third story about ten o'clock in the evening. She, the
admired centre of a large and aristocratic circle, the beautiful woman
whose intellectual force and ripe judgment had been the wonder of
her acquaintances, had been obliged, to her intense disgust, to play
the pitiable part of a supernumerary in the sick-room. In addition to
Henriette, who had taken up her position on a couch and would not
consent to leave the room, the dean's widow had made her
appearance as Kitty's nurse. She had sought refuge in the villa, for
the house by the river being the nearest to the tower had suffered
much from the explosion; the chimneys had been thrown down, the
southern wall was much damaged, the windows were shivered to
pieces, and none of the doors would latch or bolt. The friend and
companion had gone with the maid to Susy, at the mill, and the
doctor had left two watchmen to guard the house during the night.
There had been no place for Flora at the wounded girl's
bedside. At the head sat the dean's widow, her eyes red with
weeping, and opposite her the doctor. "The old woman" had
behaved as if the trifling injury that Kitty had sustained were the
gravest consequence of the disaster, and the doctor had never
stirred from his post, only relinquishing his clasp of Kitty's hand
when the bandage upon her brow needed renewing. It required
more patience and self-control than Flora had at command to look
quietly on at such anxious care bestowed upon "a tall, robust girl,
with nerves and muscles inherited from the former woodcutter's
daughter."
Weary of the perpetual whispering, and perceiving that there
was no sensible word to be extorted from all these frightened
people, the beautiful woman had at last left the room alone and
greatly irritated: the doctor had not even accompanied her to the
door. Of course she did not go to bed; she took off her evening
dress, and, putting on a white cashmere dressing-gown, reclined
towards morning upon her crimson lounge.
The former study looked desolate and dreary enough. The black
writing-table had been emptied of all its papers, and stood dusty in
the recess by the window; most of the books had been taken from
the shelves and were packed in boxes in the middle of the floor; the
pedestals were overturned, while, over all, the hanging lamp but
carelessly lighted by the servants threw a pale uncertain gleam,
which, now that the morning air and dawning light came freshly in
through the broken panes of glass, swung to and fro in its white
globe like the last faint spark of fire from the ruins.
When the day had fairly broken, Flora sent up-stairs to request
the doctor to come to her, and as his firm, military step was heard in
the corridor she hastily arranged her curls beneath her lace morning
cap, leaned back among the crimson cushions, and looked from
under her half-closed eyelids towards the door by which he was to
enter.
He came in. Never had she seen him thus, and involuntarily,
mechanically, she arose as if to greet a stranger.
"I am not well, Leo," she said with hesitation, not turning her
glance of surprise from his face, which although pale and weary was
as if inspired by some light from within that had totally changed its
character. "My head burns; fright and wet feet must have brought on
an attack of fever." She added this uncertainly, whilst his eyes dwelt
upon her with the cool searching gaze of the physician. The look
irritated her.
"Have a care, Bruck!" she said, in a perfectly calm tone, but her
breath came quick, and her finely pencilled eyebrows contracted so
that two deep lines showed between them. "For months I have
borne to see that your practice is your best beloved, to which I am
subordinate." She shrugged her shoulders. "I can foresee that such
must be my fate, and possess magnanimity enough to acquiesce in
it, since such devotion to his profession will bring fame to the man
whose name I shall bear." She turned her head as she spoke with a
haughty air, as if looking through a world filled with his renown. "But
I protest against being set aside when I have need of your medical
skill," she continued. "We have all suffered from the terrible
catastrophe. It was my task, and one of indescribable difficulty, to
protect and soothe grandmamma, who was half insane with terror,
and Henriette; and yet it has never occurred to you to ask, 'How
have you borne all this?'"
"I have not asked because I know you pride yourself upon
subordinating all emotion to the intellect, and because I can see at a
glance how little your physical condition has been affected."
She listened amazed to his tone, which, with all its wonted
calmness, trembled audibly as if in consequence of throbbing pulses.
"With regard to your second assertion you are wrong," she said,
after a moment's silence. "My temples throb with nervous
excitement. Your first may be correct; I do strive to compose myself
in view of every event whatsoever, that I may bring my calm
judgment to bear upon it. From your tone you would seem to
disapprove of this method of mine, although just at present it
certainly deserves your praise. I have never been induced to
speculate with my paternal inheritance; I have never been tempted
by fortunate chances; were it otherwise I should stand here this
moment with empty hands, my dowry would have been dispersed
upon the air like the papers that were destroyed yesterday. Yes, look
dismayed if you will, Bruck,"—she lowered her voice,—"I am not
deceived, and I choose to call things by their right names.
Grandmamma is pacing her room and wringing her hands in fear lest
the 'colossal fortune' should fall into stranger hands. Our precious
guests spent half the night bewailing the fate of the wealthy man,
fortune's darling, torn by cruel destiny so tragically from his earthly
paradise. But I say, this theatric exit was tolerably well put upon the
stage, nevertheless there is a rent in the curtain which lets in the
light of reality upon the corpse. In a short time, perhaps in a day or
two, the fact will be spread abroad that Römer was at first only a
bold speculator, it may be, but in the end—a scoundrel."
There could not have been a more striking illustration of the
wayward turns of fortune than was presented at this moment. There
stood the beautiful woman in her white Iphigenia robes, the crimson
carpet beneath her feet, the swinging lamp above her brow, upon
the very spot where in the preceding December she had stigmatized
as pretended her lover's medical skill, and had declared, "I cannot
endure concealment of my opinion."
Flora was right; she certainly called things by their right names;
she gave utterance to what the man standing before her could not in
his inmost soul deny, and which since yesterday had caused him
great pain; but to hear the naked fact thus boldly stated by those
finely chiselled lips, in order that their owner might vaunt her keen
insight, naturally offended deeply his sense of delicacy and
refinement.
"Ah, I see I am so unfortunate to-day as to displease you," she
began again, half sarcastically half poutingly, as she followed him to
the window recess whither he had gone in evident irritation. "It may
be that my speech was too downright; perhaps in view of many little
kindnesses shown me now and again by Römer it would have been
well to be less frank and true,"—she elevated her eyebrows and
shrugged her shoulders,—"but I am the sworn foe of all hypocrisy
and have reason enough for indignation. My sister Henriette, with
whose inheritance Römer has been speculating, will be a beggar;
and Kitty?—rest assured that not a stiver of all her immense fortune
is left."
"So much the better!" came as if only breathed from the lips
that seemed at this moment to be curved beneath the thick
moustache in a tender smile.
Faint as was the sound, Flora's ear caught it. "So much the
better?" she asked, in surprise, half laughing as she clasped her
hands. "Our youngest is certainly not much to my taste, but what
crime has she committed, that her ill luck should so content you?"
He bit his lip, and, pressing his forehead against the window-
frame, looked abroad into the garden, where the golden morning
light was just touching the head of the marble nymph at the
fountain.
"Of course Kitty will not be so badly off as Henriette; she will
have the castle mill, and that is worth a good round sum," she
added, after a pause. "She can live there when matters are
arranged; and indeed I know of no better refuge for our poor invalid.
The sisters are very fond of each other, and would like to be
together. In fact, no other arrangement is possible, for
grandmamma's limited income will make it impossible for her to take
charge of Henriette, and of course I should not think of burdening
you with my sick sister." She suddenly put her hand within his arm
and looked up at him tenderly. "Ah, Leo, how thankful I shall be
when we are seated together in the carriage to-morrow, leaving
behind us all this disaster and misery!"
With a passionate gesture and a face in which shone an
indignation she had never seen there before, he snatched his arm
from her clasp. "Would you really forsake them all, leave them
helpless and alone to meet the terrible shocks of the near future?"
he cried, as if beside himself. "Go then whenever you choose,—I
remain here!"
"Leo!" she almost screamed, and then stood for a moment
speechless, overpowered by anger. She laid her clenched hand upon
her heart, as if she had received a stab. "Surely you do not estimate
the full meaning of your hasty words," she said, slowly and
emphatically. "I will regard them only as they call for this reply from
me. If we do not set out upon our tour to-morrow, before further
revelations are made as to Römer's affairs,—and surely no one can
take it amiss of us that we quietly carry out plans so long decided
upon,—our union must be indefinitely postponed."
He made no reply, but stood motionless in his former position,
looking from the window. His silence evidently irritated her further:
passion gleamed in her large gray eyes.
"I said before that I am willing to yield the first place in your
heart to your practice, to your devotion to your profession," she
went on, with increasing emphasis, "but I will not yield one jot of my
rights to other women,—remember that, Leo! I cannot see why I
should be forced to struggle through the fearful crash that must
come here, with grandmamma and my sisters, when I have the right
to flee to the calm protection of the home you have promised me.
Can I do anything to alter the state of affairs? Nothing whatever.
Why, then, do you wish to consign me to needless suffering? Must I
too be an object for universal compassion? I would sooner depart on
the instant. I will not be pointed at and pitied."
She paced the room in agitation. "You have not the faintest
excuse to make me for remaining here," she said, standing at a
distance from him, frowning darkly, when she had waited in vain for
a reply. "You cannot even plead the necessity here for your
professional aid. You would have had to leave Henriette to her fate;
and as for Kitty, you will not assert that the scratch on her forehead
which you yourself declared to be trifling demands all your medical
skill. To tell the truth, I could scarcely suppress a laugh last night at
your aunt's conduct and your own. It is allowable for Henriette to
shed childish tears over a few drops of blood,—she is weak and
nervous,—but for you to behave as if our youngest, the robust child
of a race of peasants, were framed of snow and air——" She paused
at the menacing look that Leo turned upon her as he raised his
finger, unable longer to control the expression of his indignation.
She laughed angrily. "Do you think I am afraid? I return menace
for menace. Take care, the 'yes' has not yet been uttered before the
altar; it still lies with me to give a turn to affairs that you would
hardly like. I repeat that your whole conduct yesterday with regard
to Kitty was distasteful to me. Am I not to sneer at your treating her
like a princess——"
"No, not like a princess,—like the best beloved of my heart, like
my first and only love," he interrupted her, in a deep, melodious
voice.
She started as if the earth had suddenly yawned at her feet;
involuntarily she raised her arms towards heaven, and then she
approached him.
He extended his hands as if to ward off her touch, and stood
erect and decided. "Yes, I confess to you what I have hitherto
struggled fiercely to lock within my own breast, from a shame that
was the result of a perverted idea of right and wrong. I do it without
a word of excuse or self-justification——" His voice sank. "I have
been faithless to you from the moment of my first meeting with
Kitty."
Flora slowly dropped her arms. Plain and distinct as the words
were, they were the most incredible she had ever heard. Pshaw!
why had she betrayed such foolish terror? It was true that the
petted Flora Mangold had ensnared many a man's heart to reject it
pitilessly in wanton love of power: not a season had passed without
bringing her such triumphs; but that a man should prove faithless to
her—ridiculous! The idea was too absurd; no one in the capital
would credit it, herself least of all. It was far easier to believe that
Doctor Bruck had at length summoned courage to attempt to
revenge himself. She had pushed her fiery trial to extremes; in her
justifiable irritation she had threatened to withhold her "yes" on the
very altar-steps, and his long-suffering was exhausted; he was trying
to punish her by arousing her jealousy. Her boundless vanity and
frivolity postponed for a few minutes the bitterest experience of her
life.
She curled her lip ironically and folded her arms. "Ah, at first
sight, then!" she said. "Was that outside in the corridor, where she
made her appearance like a genuine child of the people, the dust of
travel on her boots and the poetic kerchief bundle in her hand?"
It was plain that her trifling irritated the man almost to
madness. At this terrible moment, when his "first and only love" had
asserted itself after suffering and struggles unspeakable, he was
laughingly taken to task like a school-boy. He controlled himself,
however. This question must be decided now; to see that it was
decided with dignity was his task.
"I had then been Kitty's guide and companion from the mill,
where I first saw her," he replied, with tolerable composure.
A dark blush of surprise crimsoned Flora's cheek. Her eyes
sparkled: she bit her lip. "Ah! this is the first I have heard of that.
She too,—the hypocrite of the 'pure' heart had her reasons for
suppressing all mention of this interesting meeting." She laughed a
short, hard laugh. "And what more, Bruck?" she demanded, her
arms still folded, one foot advanced upon the carpet.
"If you persist in this tone, no explanation is possible for me
except in writing." And he indignantly attempted to pass her.
She stepped before him. "Good heavens! how tragically you
take it! I am only doing my best to play my part in your little farce.
What! you would strive with me in a warfare of the pen? Dear Leo,
believe me, you would come off the loser there, in spite of the telling
medical brochures you have given to the world."
The arrogant smile that accompanied her words faded upon her
lips in the presence of the stern cold glance that met her own.
Gradually the suspicion dawned within her that he was indeed in
earnest, bitter earnest; not as to his pretended affection for Kitty,—
that passed all belief,—but as to his resolution, in spite of his
passionate love for herself, to break with his capricious betrothed at
the last moment rather than submit to a life-long "fiery trial." She
regretted the words she had spoken, but arrogance and vanity
retained their mastery of her.
"Then go!" she said, stepping aside. "I will not bear such looks
as the one you have just given me. Go! I will not stir a finger to
keep you." She burst into a scornful laugh. "Oh, rare masculine
nature, so vaunted and so sung! There was a time when I begged
almost upon my knees for my freedom; the chains were only the
more closely riveted upon me. Look then, and learn from me what in
such moments is the sole and only stay even for a 'vain, weak,
feminine nature:' pride——"
"It was pride that then made me inexorable,—invincible pride,
although a very different quality from the mixture of anger and
defiance which you designate as such," he interrupted her. "I
confess I was wrong,—very wrong. I will trouble you, as I have said,
with no self-justification that might seem to throw blame upon
others however remotely. The motive for my conduct then sprang
from a fancied need to assert my own force, my masculine will,
which as I thought should rise superior to all vagaries of feeling. I
would not give you back your troth because I had been accustomed
to regard my own when once plighted as pledged for all eternity.
From that point of view our betrothal was as indissoluble as a
Catholic marriage. I do not deny that the relics of my student days
had weight with me in a false conception of honour. I spoke of one
spring of action to you on that evening, and I refer to it again. I did
not choose to join the throng of those who had been bound to your
chariot-wheels only to be publicly rejected. I repeat that this was a
boyish, unformed view to take, since in such cases it is not the
man's honour, but the woman's, that is compromised."
She turned from him and drummed angrily with her fingers
upon the table. "I never concealed from you the fact that I had been
wooed repeatedly before our betrothal," she said, with proud
indifference.
"You never did, nor did any of my acquaintances," he
interposed. "But you must not forget that you were the lofty ideal of
my boyhood. At the university, in my last campaign, I was spurred
on by the thought that the proud heart so often wooed had never
inclined to any, that it would bless him who should win it——" He
broke off; he would not refer to the coquetry she had displayed; he
scorned to bring the slightest recrimination to his aid.
"And do you assert that I ever loved a single one of this throng
of inevitable adorers?" she asked, indignantly.
"Loved? No, Flora, not one; not even myself," he exclaimed,
carried away for the moment. "You loved only the incomparable
beauty, the elegant carriage, the vaunted wit, the future fame, of
the petted Flora Mangold."
"Aha! I have looked in vain for loving flattery from your lips.
Even in the first days of our betrothal you had no caressing words
for me, and now in your anger you paint a picture of me with which
I may well be content."
He blushed like a girl. It was long since he had kissed that
beautiful mouth, and yet that he had ever done so now seemed to
him an offence against that other, whose purity made her the first
and only true embodiment of his ideal woman. Involuntarily he
withdrew his glance from the eyes that gazed at him with laughter in
their depths.
Ah, she had done well to remind him of those happy first days,
—the game was her own. "Did you really come to me, Leo, only to
find fault and quarrel with me?" she asked, approaching him again
and hastily laying her hand on his arm.
"You forget that you sent for me, Flora," he replied, gravely. "I
should not have come of my own accord. I have two patients above-
stairs; Henriette's condition became critical towards morning. If you
had not expressly desired my presence I should not have left her,
nor should I, at this miserable and unhappy time, have brought
affairs to the crisis you have just provoked."
"Crisis? Because in a fit of childish vexation I told you to go!
How can you take girlish pique in such bitter earnest?" What words
from one who usually repudiated all maidenly emotion as unworthy
her masculine intellect! This slippery eel-like nature was hard to
grapple with.
The doctor looked dismayed. Her capricious words had caused
him merely to describe a circle; he was no farther with her than he
had been at the beginning of the interview. "There I do not blame
you," he answered, with a passionate impatience that would not be
suppressed. "I allowed myself to confess to you——"
"Ah, yes, you told me of your masculine will, which must rise
superior to all vagaries of feeling. Has it played you false at last?"
"No, not played me false, but submitted to better and purer
convictions. Flora, I told you awhile ago that my refusal to dissolve
the engagement between us was the result of a false principle. I had
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like