Index
Symbols() (parentheses)
criteria and, 378function creation and, 479operator precedence and, 122, 123,
129subqueries in, 164, 165, 166, 175
. (period)aliases and, 125dot operator, 255field names and, 15, 76IntelliSense and, 390parameter queries and, 143
& (ampersand)aliases and, 125character operator, 98, 99, 106, 107MsgBox and, 482underscore (_) and, 367, 376
∗ (asterisk)% v., 378in Customer_ListA table, 62, 63multiplication operator, 122Query Design view and, 35SELECT ∗, 512wildcard, 43, 146, 378, 415, 492, 496,
497! (exclamation mark)
[!] wildcard, 496, 497aliases and, 125collection operator, 255field names and, 15, 76, 125parameter queries and, 143
# (pound symbol)date type field and, 265, 377number formatting and, 325wildcard, 496, 497
? (question mark)processing instructions (<?, ?>),
425wildcard, 496, 497
[ ] (square brackets)aliases and, 125field names and, 15, 76, 125forms and, 255parameter queries and, 143wildcard, 496, 497
AAberdeen example, 33–34Abs function, 521.accdb files, 355Access
563
COPYRIG
HTED M
ATERIAL
564 Index ■ A
Access (continued)Access from Excel (automation),
411–422compacting Access database,
420–422opening Access form, 419–420opening Access report, 419running Access macro, 418–419running Access parameter query,
413–418running Access query, 412–413
data entry process (XML), 434–439data entry form in Excel, 435–436data entry schema in Access,
434–435exporting results from Excel to
XML, 436–437getting results into Access,
437–439data evolution and, 9as data layer, 349, 391, 429data size and, 8data structure and, 9as ETL tool, 508as event-driven environment, 485/Excel data transfer. See data
transfer processes/Excel integration techniques. See
integration techniquesExcel v., 3–12forms. See formsfunctional complexity and, 9Help System, 519–520
data types and, 481functions and, 521
Help system, 519–520macros. See macrosObject Library, 389, 411objects, 13, 14. See also forms;
macros; modules; queries;reports; tables
queries. See queries
reports. See reportsresources (online), 520scalability in, 5separation of data/presentation in,
7–8shared processing and, 9–10tables. See tablestransparency of analytical
processes in, 5–6Access 2007 VBA Programming For
Dummies (Simpson, ISBN:0–470–04653–8), 477
Access database engine (ACE), 313,510, 513
Access Driver, 355Access Options dialog box, 513, 518account managers (example)Date function and, 128–129IIf function and, 154–156Make-Table query and, 502RevenueSummary table and, 68, 69subqueries and, 165–168
ACE (Access database engine), 313,510, 513
action arguments, 214action queries, 56–73, 85. See also
aggregate queries; appendqueries; delete queries;Make-Table queries; updatequeries
defined, 33reasons for using, 57select queries v., 56SQL-specific, 504–508subqueries in, 173–174via SQL statements, 502–503
actions (macro actions)defined, 210essential, 216–218trusted database and, 212
Activate method, 458ActiveX Data Objects. See ADO
Index ■ A 565
ADD, 506, 507ADD CONSTRAINT, 506, 508‘‘Add Else’’ hyperlink, 226, 231Address Block, 450adLockOptimistic, 369adLockReadOnly, 369ADO (ActiveX Data Objects)
ADO/SQL data extract, 374–376fundamentals, 366–374procedure, creation of, 369–374VBA, ADO, SQL one-two-three
combination, 365, 384, 387ADO Object Library, 370–371, 375adOpenDynamic, 369adOpenForwardOnly, 369adOpenStatic, 369advanced analysis. See also domain
aggregate functions; macros;subqueries
batch analysis, 209–241descriptive statistics, 189–207functions and, 127–136
aggregate functions, 51–56. See alsodomain aggregate functions;specific aggregate functions
SQL aggregate functions, 551–552types of, 51–56
aggregate queries, 47–56, 85. See alsoaction queries
creating, 47–51crosstab, 73–85descriptive statistics with, 190–191,
207domain aggregate functions v., 177results, Make-Table query and,
59–60aliases
ampersand and, 125AS clause and, 499for column names, 50–51correlated subqueries and, 171–172
defined, 50exclamation mark (!) and, 125invalid alias name (error message),
45period (.) and, 125square brackets and, 125table, 171, 172, 499
All Access Objects, 13, 14. See alsoforms; macros; modules; queries;reports; tables
Allow Zero Length, 65Alt + F11, 370ALTER COLUMN, 506, 507ALTER TABLE statement, 506–508ampersand (&)
aliases and, 125character operator, 98, 99, 106, 107MsgBox and, 482underscore (_) and, 367, 376
And operator, 122Annualized(), 248, 249Append dialog box, 66append queries, 64–69, 85
creating, 66–69hazards of, 64–65reasons for using, 60subqueries in, 173
Application.Wait, 460, 461, 463, 464arguments
action arguments, 214calculations as, 116–117connection strings and, 366custom functions and, 248–251parameters and, 146–149
AS clause, 171, 499Asc function, 102, 522Assign Macro dialog box, 373asterisk (∗)
% v., 378in Customer_ListA table, 62, 63multiplication operator, 122
566 Index ■ A–B
asterisk (∗) (continued)Query Design view and, 35SELECT ∗, 512wildcard, 43, 146, 378, 415, 492, 496,
497Atn function, 522Attachment (data type), 17attachments, in folder
(Outlook/Excel integration),470–474
attributesColumn Headings, 84, 85XML declaration and, 424–425XML documents and, 427–428
augmenting field values, 99–100AutoExec macro, 232–238automation. See also data transfer
processes; integration techniquesforms and, 255–260macros and, 12, 209, 232–240. See
also macrosmeanings of, 209, 389VBA and, 12, 209. See also VBA
automation techniquesAccess from Excel, 411–422
compacting Access database,420–422
opening Access form, 419–420opening Access report, 419running Access macro, 418–419running Access parameter query,
413–418running Access query, 412–413
binding and, 389–391Excel data to Word document,
445–448Excel from Access, 391–411
automating data export to Excel,394–398
automating Excel reports, 398–404
Excel automation procedure,391–394
running Excel macro, 406–407macro-generated code
adjusting, 404–406optimizing, 407–411
AutoNumber, 16, 17, 53, 54, 185, 192,197, 518, 551, 552
average (calculation), 194. See alsomedian
Avg function, 53, 551
Bbackground data processing,
260–265. See also VBAbenefits of, 260–261RunSQL statements and, 261–265,
266backups (database backups)
database corruption and, 517–518delete query and, 61
bang operator, 255batch analysis, 12, 209, 216, 218–232.
See also macrosDescription property and, 221naming conventions and, 218–220setting up, 222–223
BCC, 465, 466, 467, 468, 469Beginning Access 2007 VBA (Gosnell,
ISBN: 0–470–04684–8), 477benchmarksDateAdd function and, 132–134quartile, 200–201
BETWEEN operator, 43, 145, 153, 492binding, Object Library and,
389–391blank values, 96–98. See also empty
strings; Null valuesBookmark dialog box, 446bookmarks
Index ■ B–C 567
DataTableHere, 446, 447Excel data to Word document and,
445–448simulating Mail Merge feature
(from Excel) and, 452–456brackets. See square bracketsBranch_Number field, 175, 180, 190,
191, 203, 206btnRunAll, 258btnRunMarket command button, 257Byte, 16, 558, 560
CCalculated data types, 17, 137–139,
140calculation variables, 146, 147calculations, 113–140. See also date
calculationsas arguments in functions, 116–117average, 194constants in, 114errors, 122–125. See also Null values
Null values and, 123–125, 186NZ function and, 123–125, 186, 543operator precedence and, 122–123syntax and, 125
Expression Builder and, 117–121fields in, 115in functions (as arguments),
116–117median, 194–196online, 137real-time, 114, 137, 140results of aggregation in, 115, 116results of one calculation as
expression of another, 115–116stored, 113–114, 139–140
California (examples)filtering query results, 38, 39, 41, 42,
43leading/trailing spaces and, 103
subqueries and, 164, 168camel case, 220capitalization. See also case
sorting by, 102case
changing, 100–102LCase function and, 101, 539StrConv function and, 101, 553UCase function and, 101, 558
Category area (pivot charts),314–316
cboLocations combo box, 257central repository, of custom
functions, 246–247changing case. See casecharacter markers, parsing strings
with, 109–112character operator, ampersand, 98,
99, 106, 107Choose Builder dialog box, 258, 484Choose Data Source dialog box, 354,
355, 356Choose function, 522Chr function, 523ChrW function, 332, 335, 337, 344class modules, 478cleaning data. See data
transformationclient application, 390CloseWindow, 216Code Builder, 258, 484, 485collapsed state (macros), 222column alias, 499Column Headings attribute, 84, 85column names, aliases for, 50–51Columns dialog box, 288combo boxes, 255, 256, 257, 258–260command button control, 252, 253Command Button Wizard, 252, 484command lines, 238–240command-line switches, 238–240comments (XML), 425
568 Index ■ C
Compact and Repair utility, 27,420–422, 513, 518
CompanyNumber field, 90, 92, 95,107, 108
comparison operators, 43, 122, 169operator precedence and, 122subqueries and, 169WHERE clause and, 492
compound primary keys, 21–22concatenation, 98–100conditional analysis, 141–159
defined, 141, 159IIf functions, 141, 150–156, 159, 535
crosstabs and, 154–156mathematical errors and, 150–152nesting, 154–156, 157, 158saving time with, 152–154Switch function v., 157–158
parameter queries, 143–149, 159arguments and, 146–149calculation variables and, 146, 147defined, 141, 159Enter Parameter Value dialog box
and, 142, 143, 149, 159, 414,415
functionality of, 143ground rules of, 143–144multiple parameter conditions
and, 144operators and, 145wildcards and, 145–146, 254,
415–416working with, 144–149
Switch function, 141, 150, 156–158,159, 554–555
IIf function v., 157–158power of, 156syntax, 156–157
conditional formatting, 326–331Conditional Formatting dialog box,
327, 331
Conditional Formatting RulesManager dialog box, 337, 338
conditional functions, 149–158conditions, macros and, 223–228connection strings, 366–368ConnectString, 368constants
in calculations, 114defined, 114
Contact_FirstName field, 110, 111Contact_LastName field, 110, 111ContactName field, 109, 110, 112CopyFromRecordset, 372, 373, 375, 376,
381, 382, 383, 387, 394, 395, 396,397, 413, 417, 418
CopyPicture, 458, 459, 460, 461, 463,464
correlated subqueries, 170–173, 192corruption. See databasesCos function, 523Create PivotTable dialog box, 399CREATE TABLE statement, 506criteria, 38, 41, 42, 43
date criteria, 181, 377domain aggregate functions and,
180–181multiple criteria, 41, 42, 43, 377–378numeric criteria, 180–181, 377single criterion, 41, 144in SQL statements, 376–378textual criteria, 180, 377
criteria expressionDate function in, 127–128double quotes and, 180
crosstab queries, 73–85creation
Crosstab Query Wizard, 74–79manual creation, 79–82
customizing, 82–85Make-Table queries and, 78–79structure of, 73
Crosstab Query Wizard, 74–79
Index ■ C–D 569
crosstabs, 12IIf function and, 154–156TRANSFORM statement and, 503–504
Currency (data type), 17, 53, 54, 551,552
cursor types, 368–369CursorType, 368Custom Filter dialog box, 33, 272custom functions, 244–251, 265–266
central repository of, 246–247creating
accepts arguments, 248–251first, 245–247
in forms, 250in queries, 249–250uses for, 249–251
Customer_ListA table, 62, 63
DDAO (Microsoft Data Access
Objects), 411, 412, 413, 417, 515DAO Object Library, 411, 412dashboard graphics, 323, 331, 334,
335, 339–343, 344data
duplicate. See duplicate recordsimporting, 22–26linking, 27–28/presentation, separation of, 7–8presenting. See reportssplitting. See relational databases
Data Access Objects (DAO,Microsoft), 411, 412, 413, 417, 515
data analysis. See also advancedanalysis
ExcelAccess v., 3–12problem areas, 3–8
indicatorsdata evolution, 9data size, 8
data structure, 9functional complexity, 9shared processing, 9–10
data bars, 331–335data entry process (XML), 434–439
data entry form in Excel, 435–436data entry schema in Access,
434–435exporting results from Excel to
XML, 436–437getting results into Access, 437–439
data layer. See also presentation layerAccess as, 349, 391, 429data/presentation separation and,
7–8Data Link Properties dialog boxes,
351Data Source, 366data transfer processes. See also
integration techniquesAccess to Excel, 347–363
automation procedure, 391–398Drag and Drop method, 347–348,
362Export wizard, 348–350, 363Get External Data method,
350–353, 363MS Query, 353–363
Excel to Access, 22–26form to query, 251–255pivot charts and, 321pivot table to Excel, 303VBA (with ADO/SQL), 365–387
ADO fundamentals, 366–374ADO/SQL data extract, 374–376common scenarios, 380–387criteria in SQL statements,
376–379data transformation, 89–112
adding text in key positions,105–107
570 Index ■ D
data transformation, (continued)blank values, 96–98. See also empty
strings; Null valueschanging case. See caseconcatenation, 98–100duplicate records, 89–96leading/trailing spaces, 103, 557padding strings, 107–108parsing strings, 109–112replacing text, 103–104
data types, 15–17Attachment, 17AutoNumber, 16, 17, 53, 54, 185,
192, 197, 518, 551, 552Calculated, 17, 137–139, 140Currency, 17, 53, 54, 551, 552Date/Time, 17, 53, 54, 551, 552defined, 15delimited text, 26Help System and, 481Hyperlink, 16, 17Lookup Wizard and, 16Memo, 16Number, 16–17OLE Object, 17, 340–341, 344Text, 16, 18, 54, 552wrong data type for parameter
(error message), 45Yes/No, 11, 16, 17, 53
data visualizations. See visualizationtechniques
database objects, 13, 14. See alsoforms; macros; modules; queries;reports; tables
databases. See also tablesbackups. See backupsCompact and Repair utility, 27,
420–422, 513, 518corruption, 513–519
interruption of service and,518–519
preventing, 517–519
recovering, 516–517.laccdb file and, 517, 519relational database concept, 28–32on removable media, 519trusted, 211–213, 214, 216, 217, 218,
233ZalexCorp, 347, 348, 355, 356, 357,
358ZalexCorp Restaurant Equipment
and Supply.accdb, 372, 373,375, 376, 382, 383, 391, 395, 412,417, 418, 419, 420
Datasheet view, 14, 18, 19, 33, 302,514
Date area (pivot charts), 314date calculations, 125–137, 140
adding days to dates, 126advanced, functions and, 127–137Day function, 130–132, 528days between dates, 126grouping dates into quarters,
134–135Month function, 130–132, 5411900 system and, 125simple, 126Weekday function, 130–132, 560Year function, 130–132, 561
date criteria, 181, 377Date function, 127–130, 523
in criteria expression, 127–128differences between two dates
days, 127years, 128–130
date parameters, from form, 265date type field, # and, 265, 377DateAdd function, 132–134, 523–524DateDiff function, 146–147, 167,
524–525DatePart function, 526–527DateSerial function, 136–137, 527Date/Time (data type), 17, 53, 54,
551, 552
Index ■ D 571
Date/Time functions, 127–137DateValue function, 527DAvg function, 187, 529Day function, 130–132, 528DCount function, 178, 183, 184, 187,
226, 230, 530DDB function, 528Decimal, 17, 558, 560Decimal Places (field property), 21declaration, XML, 424–425Default Value (field property), 21delete queries, 60–63, 85
creating, 61–63DELETE statement and, 503deleting records from tables (based
on records from another),62–63
hazards of, 61reasons for using, 60subqueries in, 174
DELETE statement, 503DeleteObject, 216delimited text, 26Description property, 221descriptive statistics, 189–207
advanced, 198–207with aggregate queries, 190–191,
207basic, 190–198frequency distributions and,
202–204inferential statistics v., 189median and, 194–196mode and, 192–194percentile ranking and, 198–200quartile standings and, 200–202random sampling and, 196–198rank and, 191–192
designnormalizing database design, 510query design, 512
Design view. See also Query Designview
defined, 15query creation in, 48reports and, 273–275, 285–289table creation and, 17–19
Detail section (reports), 275DFirst function, 179, 187, 530dialog box
Access Options, 513, 518Append, 66Assign Macro, 373Bookmark, 446Choose Builder, 258, 484Choose Data Source, 354, 355, 356Columns, 288Conditional Formatting, 327, 331Conditional Formatting Rules
Manager, 337, 338Create PivotTable, 399Custom Filter, 33, 272Data Link Properties, 351Edit Formatting Rule, 329Enter Parameter Value, 142, 143,
149, 159, 414, 415Export XML, 430, 435Export-XML File, 429External Data Properties, 361Field Properties, 51Get External Data-XML File, 438Import, 360Insert Page Numbers, 276Links, 444Macro, 400Manage Data Tasks, 430, 431Microsoft Office Security Options,
212New Formatting Rule, 328New Query, 74, 91ODBC Microsoft Access Setup, 356Paste Special, 443Paste Table As, 94
572 Index ■ D–E
dialog box (continued)Properties, 221, 239, 304, 306, 311,
312, 319, 361Property Sheet, 50, 51, 96, 174, 302,
500Query Properties, 84References, 370, 371, 392, 446Replace, 405Run, 234Save As, 19, 486Save Import Steps, 25–26Show Table, 34, 35, 48, 491Totals, 281Zoom, 166, 175, 176
Dim_Customers table, 14, 15, 35, 39,70, 164, 501, 502
Dim_Transactions table, 39–40, 74,178, 179, 180
DisplayAlerts property, 404. See alsoSetWarnings action
DISTINCT, 165, 496DISTINCTROW, 498division by zero (error message), 44DLast function, 179, 187, 530DLookup function, 179, 184, 185, 187,
530DMax function, 179, 187, 530DMin function, 179, 187, 530DoCmd, 253, 257, 261, 262, 420documents, XML
attributes, 427–428comments, 425components, 424–429elements, 425–426namespaces, 428–429processing instructions, 425root element, 426–427
domain aggregate functions, 6, 163,177–186, 187, 529–530
aggregate queries v., 177anatomy of, 178guidelines for building, 179–181
list of, 178–179parameter queries and, 178uses for, 177, 181–186
dot operator (.), 255. See also periodDouble, 16, 17, 558, 560double quotes
attributes (XML documents) and,427
criteria expression and, 180SQL and, 381
Drag and Drop method, 347–348,362
DROP COLUMN, 506, 507DStDev function, 187, 530DStDevP function, 179, 187, 530DSum function, 178, 182, 184, 187, 333,
334, 529duplicate records, 89–96
defining, 90–91finding, 91–94flat-file format and, 30primary keys and, 21relational databases and, 30–31removing, 94–96
DVar function, 179, 187, 530DVarP function, 179, 187, 530dynamic link (to Excel table),
442–445
Eearly binding, 390, 391Edit Formatting Rule dialog box, 329elements (XML), 425–426ellipses, 227EmailDatabaseObject, 218embedding. See also nesting
Calculated data type and, 137–139,140
OLE Object field and, 340–341, 344empty strings, 97. See also Null
values
Index ■ E 573
encoding attribute (XMLdeclaration), 424
Enter Parameter Value dialog box,142, 143, 149, 159, 414, 415
enumerating through combo box,258–260
equal (=)Like operator v., 496WHERE and, 492
errorscalculation errors, 122–125. See also
Null valuesNull values and, 123–125, 186NZ function and, 123–125, 186, 543operator precedence and, 122–123syntax and, 125
database corruption, 515–516mathematical, IIf function and,
150–152query errors, 44–45
append queries, 64–65delete queries, 61Make-Table queries, 57–58update queries, 72–73
SQL statements, 378–379ETL (Extract, Transform, Load) tool,
508event-driven environment, 485Excel
/Access data transfer. See datatransfer processes
/Access integration techniques. Seeintegration techniques
Access v., 3–12data entry process (XML), 434–439
data entry form in Excel, 435–436data entry schema in Access,
434–435exporting results from Excel to
XML, 436–437getting results into Access,
437–439
data evolution and, 9data size and, 8data structure and, 9Excel from Access (automation),
391–411automating data export to Excel,
394–398automating Excel reports, 398–404Excel automation procedure,
391–394running Excel macro, 406–407
flat-file format and, 29–30functional complexity and, 9Object Library, 389, 391, 392, 402Outlook/Excel integration
techniquesmailing specific range, 466–468mailing to email addresses in
contact list, 468–469making active workbook, 465–466saving attachments in folder,
470–474PowerPoint/Excel integration
techniquesconverting workbook to
presentation, 462–465copy cells to presentation,
458–459PowerPoint slide with title,
456–458sending Excel charts to
presentation, 460–462as presentation layer, 327, 429problem areas, 3–8records, Access table and, 384–386scalability in, 5separation of data/presentation in,
7–8shared processing and, 9–10table, appending records to,
382–383
574 Index ■ E–F
Excel (continued)transparency of analytical
processes in, 5–6Word/Excel integration techniques
dynamic link to Excel table,442–445
Excel data to Word (automation),445–448
simulating Mail Merge featurefrom Excel, 452–456
Word Mail Merge feature,448–452
workbook, query data from,380–382
Excel 2007 Pivot Table Data Crunching(ISBN: 0789736012), 291
Excel 2007 VBA Programmer’sReference (Wiley, ISBN:978–0–470–04643–2), 434
ExcelMaster.xlsx file, 22exclamation mark (!)
[!] wildcard, 496, 497aliases and, 125collection operator, 255field names and, 15, 76, 125parameter queries and, 143
Exp function, 531Export wizard, 348–350, 363Export XML dialog box, 430, 435ExportWithFormatting, 217Export-XML File dialog box, 429Expression aggregate function, 54–55Expression Builder, 117–121, 137,
246expressions
correlated subqueries as, 173custom functions and, 244–245. See
also custom functionsdefined, 114expression too complex (error
message), 44nested, 44
subqueries as, 170in update queries, 72
Extended Properties, 366–367external data properties, 361–362External Data Properties dialog box,
361Extract, Transform, Load (ETL) tool,
508
Ffailures. See errorsfield names, 15
brackets/period/exclamation markand, 15, 76, 125
spaces in, 15field properties, 19–21Field Properties dialog box, 51Field Size, 19–20field values, augmenting, 99–100fields. See also specific fields
blank, 96–98Branch_Number, 175, 180, 190, 191,
203, 206in calculations, 115CompanyNumber, 90, 92, 95, 107,
108Contact_FirstName, 110, 111Contact_LastName, 110, 111ContactName, 109, 110, 112date type, # and, 265, 377defined, 15Forecast, 124, 125, 151indexes on, 9, 23–25, 510–512Memo, 16MyTest, 98, 99, 100, 105, 106, 152,
153OLE Object, 17, 340–341, 344Overdue, 133, 134Percent Increase, 137–138Product_Category, 68, 69, 81, 277,
278, 279, 280
Index ■ F 575
Revenue, 180, 203, 248, 296, 297,298, 300, 301, 303, 316, 330, 333
True/False, 17. See also Yes/Noas utility, 54Warning, 133, 134
filling blank fields, 96–98Filter area (pivot charts), 316filtering. See also criteria
query results, 38–39/sorting, for on-the-fly analysis,
33–34Find and Replace feature, 104. See
also Replace functionFind Duplicates Query Wizard, 91,
92, 93, 94First function, 54, 552FirstDayLastMonth function, 250, 251flat-file format, 29–30Forecast field, 124, 125, 151form controls
combo boxes, 255, 256, 257, 258–260list boxes, 255, 355, 357option groups, 255text boxes, 251, 252, 287
form modules, 478Format (field property), 20Format function, 134–135FormatCurrency function, 531FormatDateTime function, 532FormatNumber function, 532–533FormatPercent function, 533–534formatting
conditional, 326–331number formatting (for reports),
324–326pivot charts, 319–321
forms (Access forms), 251–260, 266automation and, 255–260custom functions in, 250data transfer (form to query),
251–255date parameters from, 265
defined, 251frmMktRpts, 255–256, 258functions in, 484–485numeric parameters from, 265syntax for referencing, 255textual parameters from, 264–265
For...Next loop, 259, 456frequency distributions, 202–204frmMktRpts form, 255–256, 258FROM, 379, 495functional complexity, 9functions. See also arguments;
domain aggregate functions;specific functions
advanced analysis and, 127–136calculations (as arguments) in,
116–117compiling, 482conditional, 149–158creating, 478–482custom, 244–251, 265–266date calculations with, 127–137defined, 478DStDevP, 179, 187, 530Expression Builder and, 117–121,
137, 246in forms, 484–485Help System and, 521Insert Function wizard, 118, 119.
See also Expression Builderin macros, 483nested, 106procedures and, 479–480reference list, 521–561Abs, 521Asc, 102, 522Atn, 522Avg, 53, 551Choose, 522Chr, 523ChrW, 332, 335, 337, 344Cos, 523
576 Index ■ F
functions. (continued)Date function. See Date functionDateAdd, 132–134, 523–524DateDiff, 146–147, 167, 524–525DatePart, 526–527DateSerial, 136–137, 527DateValue, 527DAvg, 187, 529Day, 130–132, 528DCount, 178, 183, 184, 187, 226, 230,
530DDB, 528DFirst, 179, 187, 530DLast, 179, 187, 530DLookup, 179, 184, 185, 187, 530DMax, 179, 187, 530DMin, 179, 187, 530DStDev, 187, 530DSum, 178, 182, 184, 187, 333, 334,
529DVar, 179, 187, 530DVarP, 179, 187, 530Exp, 531Expression, 54–55First, 54, 552FirstDayLastMonth, 250, 251Format, 134–135FormatCurrency, 531FormatDateTime, 532FormatNumber, 532–533FormatPercent, 533–534FV, 534Group By, 52–53Hour, 535IIf. See IIf functionsInStr, 109–110, 148, 149, 473,
535–536InStrRev, 536Int, 116–117, 129, 130, 195IPmt, 537IRR, 537IsError, 538
IsNull, 538IsNumeric, 538Last, 54, 552LCase, 101, 539Left, 105–106, 110, 539Len, 197, 539Log, 540LTrim, 103, 557Max, 54, 552Mid, 105–106, 107, 110, 540Min, 54, 552Minute, 540–541MIRR, 541Month, 130–132, 541MonthName, 542Now, 542NPer, 542–543NPV, 543NZ, 123–125, 186, 543Partition, 202–204, 205, 544Pmt, 544–545PPmt, 545PV, 546Rate, 546–547Replace, 104, 547–548Right, 105–106, 107, 108, 110, 548Rnd, 196–197, 548–549Round, 120, 121, 129, 549RTrim, 103, 557Second, 549Sgn, 550Sin, 550SLN, 550Space, 551Sqr, 552StDev, 53, 551StrConv, 101, 553STRING, 331–334, 344, 554StrReverse, 554Sum, 53, 551Switch. See Switch functionSYD, 555
Index ■ F–I 577
Tan, 555Time, 556. See also Date/Time
functionsTimeSerial, 556TimeValue, 460, 463, 556–557Trim, 103, 557TypeName, 557–558UCase, 101, 558Var, 53, 552VarType, 559–560Weekday, 130–132, 560WeekdayName, 561Year, 130–132, 561
saving, 482–483SQL aggregate functions, 551–552testing, 480
FV function, 534
G‘‘garbage in, garbage out,’’ 510Get External Data method, 350–353,
363Get External Data-XML File dialog
box, 438GetAccessData, 371, 372, 373, 375Gosnell, Denise, 477graphics table, 340, 341–342greater than (>), 43, 492greater than or equal to (>=), 43, 492Greeting Line, 451Group, Sort, and Total pane, 277,
279, 280, 282, 286Group By aggregate function, 52–53GROUP BY clause, 165, 379, 498group-by queries. See aggregate
queriesgrouped reports, 276–282
Hhash symbol. See pound symbolHAVING clause, 498
hazards. See errorsHelp System (Access), 519–520
data types and, 481functions and, 521
histogram chart, 204–207HLOOKUP, 31Holidays table, 131–132Hour function, 535hyperlink, ‘‘Add Else’’, 226, 231Hyperlink (data type), 16, 17
IIf...Then, 224–225If...Then...Else, 154, 157, 225–228,
243, 245, 266, 365, 387IIf functions, 141, 150–156, 159, 535
crosstabs and, 154–156mathematical errors and, 150–152nesting, 154–156, 157, 158saving time with, 152–154Switch function v., 157–158
Import dialog box, 360Import Spreadsheet Wizard, 22–26ImportExportData, 212, 217ImportExportSpreadsheet, 218ImportExportText, 218importing data. See data transfer
processesIN operator, 43, 168–169Indexed property, 511indexes, 9, 23–25, 510–512inferential statistics, 189inner joins, 493Input Mask, 20–21Insert Function wizard, 118, 119. See
also Expression BuilderINSERT INTO, 173, 263, 503Insert Page Numbers dialog box, 276InStr function, 109–110, 148, 149,
473, 535–536InStrRev function, 536
578 Index ■ I–L
Int function, (continued)Int function, 116–117, 129, 130, 195Integer, 16, 481, 558integration techniques. See also
automation; data transferprocesses
Excel/Outlook, 465–474mailing specific range, 466–468mailing to email addresses in
contact list, 468–469making active workbook, 465–466saving attachments in folder,
470–474Excel/PowerPoint, 456–465
converting workbook topresentation, 462–465
copy cells to presentation,458–459
PowerPoint slide with title,456–458
sending Excel charts topresentation, 460–462
Excel/Word, 441–456dynamic link to Excel table,
442–445Excel data to Word (automation),
445–448simulating Mail Merge feature
from Excel, 452–456Word Mail Merge feature,
448–452XML and, 423–440
integrative techniques,Excel/PowerPoint
converting workbook topresentation, 462–465
copy cells to presentation, 458–459PowerPoint slide with title,
456–458sending Excel charts to
presentation, 460–462IntelliSense, 390, 391, 479, 480
interruption of service, 518–519
invalid alias name (error message),
45
invalid argument (error message), 45
IPmt function, 537
IRR function, 537
Is Null operator, 43
IsError function, 538
IsNull function, 538
IsNumeric function, 538
JJet, 313. See also ACE
joins, 493–495
Kkey violation, 64
L.laccdb file, 517, 519
‘‘LARGE’’ update value, 152, 153
Last function, 54, 552
LastDayThisWeek(), 245–246
late binding, 390–391
Layout View, 273, 276, 277, 279, 280,
282
LCase function, 101, 539
leading/trailing spaces, 103
LTrim function and, 103, 557
RTrim function and, 103, 557
Trim function and, 103, 557
LeadList table, 90, 92, 94, 95, 100, 111
LeadList_NoDups table, 94, 95
Left function, 105–106, 110, 539
Len function, 197, 539
Index ■ L–M 579
less than (<), 43, 492less than or equal to (<=), 43, 492Like operator, 43, 378, 496–497Link Spreadsheet Wizard, 27–28linking data, Excel worksheet to
Access, 27–28Links dialog box, 444list boxes, 255, 355, 357LocationMaster table, 226lock violation, 64LockType, 368Log function, 540Long Integer, 16, 17, 558, 559. See also
AutoNumberLookup Wizard, 16loopingFor...Next, 259, 456with macros, 228–232
LoopList table, 229, 230, 231LTrim function, 103, 557
MMacro dialog box, 400macros (Access macros), 209–241
actionsdefined, 210essential, 216–218trusted database and, 212
advantages of, 209–210automation and, 12, 209, 232–240collapsed state, 222conditions and, 223–228conversion, to VBA code, 485–488creating, 213–216editing, 216functions in, 483If...Then scenario, 224–225If...Then...Else scenario, 225–228introduction to, 210–218looping with, 228–232scheduling, 232–240
AutoExec macro and, 232–238command lines and, 238–240
security and, 210–213, 418mail merge, 448Mail Merge feature
creating document, 448–452simulating, from Excel, 452–456
MailMerge.docx document, 453MainSummary table, 172, 396Make-Table queries, 57–60, 85, 502
aggregate query results and, 59–60CREATE TABLE statement v., 506creating, 58–60crosstab queries and, 78–79hazards of, 57–58Query Design view and, 58, 68subqueries in, 173
Manage Data Tasks dialog box, 430,431
many-to-many relationships, 32many-to-one-to-many relationship,
45, 73mathematical errors, IIf function
and, 150–152mathematical operators. See
comparison operatorsMax function, 54, 552.mdb files, 355median, 194–196Memo field, 16Microsoft ActiveX Data Objects
Library, 370, 371. See also ADOMicrosoft Data Access Objects
(DAO), 411, 412, 413, 417, 515Microsoft Office applications. See
Access; Excel; integrationtechniques
Microsoft Office Security Optionsdialog box, 212
Microsoft Query. See MS QueryMicrosoft Query wizard, 354, 357,
359
580 Index ■ M–O
Mid function, 105–106, 107, 110, 540Min function, 54, 552Minute function, 540–541MIRR function, 541mode, 192–194modules (VBA), 478Month function, 130–132, 541MonthName function, 542moving data. See data transfer
processesMS Query (Microsoft Query),
353–363MS Query wizard, 354, 357, 359multi-column report layout, 288–289multiple criteria, 41, 42, 43, 377–378multiple tables, queries on, 39–41MyCell, 454, 469MyContacts, 469MyDatabase, 413, 417MyParametersQuery, 416, 418MyQueryDef, 412, 413, 417MyRange, 383, 447, 464MyRecordSet, 372, 373, 381, 382, 385,
386, 395, 413, 417MySQL variable, 264, 376, 381, 385MyTest field, 98, 99, 100, 105, 106,
152, 153MyTitle, 463, 464
NName property, 252, 253, 258namespaces, 428–429naming conventions, 218–220
field names, 15brackets/period/exclamation
mark and, 15, 76spaces in, 15
object names, 218–220overwrite warnings and, 25, 57–58,
59, 349, 404, 473query names, 219–220
nesting. See also embedding;subqueries
expressions, 44functions, 106IIf functions, 154–156, 157, 158InStr function, 110subqueries and, 44, 164, 165, 186
New Formatting Rule dialog box, 328New Query dialog box, 74, 911900 system, 125non-workdays/workdays, 131–132normalizing database design, 510not equal (<>), 492NOT IN operator, 168–169, 175Not operator, 43, 122Now function, 542NPer function, 542–543NPV function, 543Null values
calculation errors and, 123–125, 186defined, 123filling in, 96–98NZ function and, 123–125, 186, 543
Number (data type), 16–17number formatting (for reports),
324–326numeric criteria, 180–181, 377numeric parameters, from form, 265NZ function, 123–125, 186, 543
OObject Library
Access, 389, 411ADO, 370–371, 375binding and, 389–391DAO, 411, 412Excel, 389, 391, 392, 402Outlook, 465PowerPoint, 456references and, 411–412Word, 446
Index ■ O–P 581
Object Linking and Embedding. SeeOLE
ODBC Microsoft Access Setup dialogbox, 356
Offset method, 455OLApp, 465, 466, 468, 469OLApp.Session.Logon, 465, 466, 467,
468, 469OLE (Object Linking and
Embedding), 340OLE Object field, 17, 340–341, 344OLMail, 465, 466, 468, 469On Click event, 253, 258one-to-many relationships, 31–32one-to-one relationships, 31one-two-three combination (VBA,
ADO, SQL), 365, 384, 387online calculations, 137. See also
Calculated data typeson-the-fly analysis. See also
subqueriessorting/filtering for, 33–34subqueries and, 165
OpenForm, 216, 420OpenQuery, 216, 223, 230, 231, 253, 261,
262OpenReport, 216, 419OpenTable, 214, 215, 216‘‘operation must use an updateable
query,’’ 45, 72–73operator precedence, 122–123operators. See also specific operators
comparison, 43, 122, 169, 492Like, 43, 378, 496–497parameter queries and, 145in select queries, 41–44
optimizing query performance. Seequery performance
option groups, 255Or operator, 42, 122ORDER BY clause, 499out of memory (error), 44
outer joins, 494–495Outlook Object Library, 465Outlook/Excel integration
techniquesmailing specific range, 466–468mailing to email addresses in
contact list, 468–469making active workbook, 465–466saving attachments in folder,
470–474Overdue field, 133, 134overflow message, 44overwrite warnings, 25, 57–58, 59,
349, 404, 473
Ppadding strings, 107–108page break issues, 282Page Footer section, 275–276Page Header section, 274, 275–276parameter prompt, 143, 145, 148–149parameter queries, 143–149, 159
arguments and, 146–149calculation variables and, 146, 147defined, 141, 159domain aggregate functions and,
178Enter Parameter Value dialog box
and, 142, 143, 149, 159, 414, 415functionality of, 143ground rules of, 143–144multiple parameter conditions and,
144operators and, 145wildcards and, 145–146, 254,
415–416working with, 144–149
parameters, user-defined, 264–265parentheses ( )
criteria and, 378function creation and, 479
582 Index ■ P
parentheses ( ) (continued)operator precedence and, 122, 123,
129subqueries in, 164, 165, 166, 175
parsing strings, 109–112Partition function, 202–204, 205, 544passing data. See data transfer
processespassing parameters, from form,
264–265Password argument, 367Paste Special dialog box, 443Paste Table As dialog box, 94PasteTable.docx, 446percent (%) character, 378, 533Percent Increase field, 137–138percent of total (domain aggregate
functions), 182–183percentile ranking, 198–200period (.)
aliases and, 125dot operator, 255field names and, 15, 76, 125IntelliSense and, 390parameter queries and, 143
pivot cache, 4, 303, 352pivot charts, 291, 313–321
Category area, 314–316creating, 316–318Date area, 314Filter area, 316formatting, 319–321fundamentals, 314–316Series area, 314
pivot tables, 291–313, 321anatomy of, 292–295creating
advanced, 300–302basic, 295–300
Excel 2007 Pivot Table DataCrunching, 291
options, 303–313
adding calculated total, 311–313changing field captions, 304–305date groupings, 308–309expanding/collapsing fields, 304filter for top/bottom records, 310grouping data, 306–308sorting data, 306
saving, 302sending to Excel, 303
Pmt function, 544–545pound symbol (#)
date type field and, 265, 377number formatting and, 325wildcard, 496, 497
Powering Office 2003 with XML (ISBN:0764541226), 439
PowerPoint Object Library, 456PowerPoint/Excel (integration
techniques)converting workbook to
presentation, 462–465copy cells to presentation, 458–459PowerPoint slide with title,
456–458sending Excel charts to
presentation, 460–462PP, 457, 459, 461, 463ppLayoutBlank, 457, 460, 462ppLayoutTitleOnly, 457, 458, 459, 463,
464PPmt function, 545PPPres, 457, 459, 461, 464PPSlide, 457, 459, 461, 464PPSlideCount, 460, 461, 464precedence (operator precedence),
122–123preprogrammed functions. See
actionspresentation layer. See also data
layer; Excel; reportsExcel as, 327, 429forms as, 251, 266
Index ■ P–Q 583
reports as, 11, 269, 289separation of presentation/data,
7–8presentations (PowerPoint)
cells copied to, 458–459Excel charts sent to, 460–462workbook converted to, 462–465
presenting data. See reportsprimary keys, 19, 21–22
compound, 21–22defined, 21relational databases and, 30–31
PrintOut, 217procedures (routines), 479–480processing instructions, 425Product_Category field, 68, 69, 81,
277, 278, 279, 280ProductID, 52, 56, 74, 75, 77Properties dialog box, 221, 239, 304,
306, 311, 312, 319, 361Property Sheet dialog box, 50, 51, 96,
174, 302, 500Property Sheet pane, 275, 283, 284,
324Provider, 366, 367, 368PV function, 546PvTblFeed table, 180, 394, 395, 396
QQBD. See Query Design viewQBE. See Query Design viewquarters, converting dates into,
134–136quartiles
of dataset (example), 174–176defined, 200quartile standings, 200–202
queries (Access queries), 11. See alsoaction queries; aggregate queries;parameter queries; select queries;SQL; specific queries
basics, 32–45custom functions in, 249–250data bars and, 331–335defined, 33, 46errors, 44–45hazards. See errorsnaming convention, 219–220SQL-specific, 504–508symbols and, 335–339visualizations and. See
visualization techniquesworkdays/non-workdays and,
131–132Query Builder, 283Query by Design. See Query Design
viewQuery by Example. See Query
Design viewquery design, 512Query Design view
append query and, 66Make-Table query and, 58, 68MyParametersQuery and, 416, 418ProductID and, 52query creation and, 520select query creation and, 34–44, 48subquery in, 164update query and, 70
query grid, 35, 36, 37, 38, 40, 43, 49,63, 67, 70, 80, 81, 84, 96, 118, 121,166, 174, 500, 504
query optimizer, 509–510, 518query performance, 509–513Query Properties dialog box, 84querying text files, 386–387Query_Products, 270, 271, 273, 274,
277, 372, 373, 382, 383question mark (?)
processing instructions (<?, ?>),425
wildcard, 496, 497QuitAccess, 212, 216, 233
584 Index ■ R
Rrandom sampling, 196–198ranking records, 191–192Rate function, 546–547
real timecalculations in, 114, 137, 140linked Excel sheets in, 27reports in, 271, 273
Record Source property, 283, 284record-level testing, 243, 245, 261,
266, 365, 387records
defined, 14duplicate. See duplicate recordsquartile standings of, 200–202ranking, 191–192
Recordset, 368–369‘‘recordset is not updateable,’’ 45,
72–73recovering corrupted databases,
516–517reference list. See functionsReferences dialog box, 370, 371, 392,
446relational databases, 28–32. See also
databasesrelationship types, 31–32
many-to-many relationships, 32many-to-one-to-many relationship,
45, 73one-to-many relationships, 31–32one-to-one relationships, 31
removable media, databases on, 519removing leading/trailing spaces.
See leading/trailing spacesReplace dialog box, 405Replace function, 104, 547–548Replication ID, 16Report Footer section, 276Report Header section, 274report modules, 478
Report View, 271–272, 273, 282, 287,326, 328, 335
Report wizard, 289reports (Access reports), 11–12,
269–289basics, 269–276creating, 269–271, 283–289data bars and, 331–335Design view and, 273–275, 285–289Excel reports automation, 398–404grouped, 276–282Layout View and, 273, 276, 277,
279, 280, 282multi-column report layout,
288–289number formatting and, 324–326as presentation layer, 11, 269, 289sections of, 274–276sorting, 279–282symbols and, 335–339totaling, 279–282viewing, 271–276visualizations and. See
visualization techniquesXML reporting solution, 429–434
repository, of custom functions,246–247
Required (field property), 21Required Field set to yes, 65Revenue field, 180, 203, 248, 296, 297,
298, 300, 301, 303, 316, 330, 333RevenueSummary table, 68, 69Right function, 105–106, 107, 108,
110, 548right joins, 494Rnd function, 196–197, 548–549root element, 426–427Round function, 120, 121, 129, 549routines. See proceduresRTrim function, 103, 557Run command, 233Run dialog box, 234
Index ■ R–S 585
RunCode, 217, 483RunMacro, 217, 226, 230running count (domain aggregate
functions), 183–184RunSavedImportExport, 212, 350, 431RunSQL action, 217RunSQL method, 261–262, 264RunSQL statements, 261–265, 266
advanced techniques, 263–265anatomy of, 262
SSalesHistory table, 59, 61, 66, 67, 72Save As dialog box, 19, 486Save Import Steps dialog box, 25–26scalability (Excel problem area), 4–5Scheduled Task Wizard, 234scheduling macros, 232–240
AutoExec macro and, 232–238command lines and, 238–240
Second function, 549second quartile of dataset (example),
174–176security
Access, 211, 213, 233, 244, 418macros and, 210–213, 418
Select Database dialog box, 350, 356,357
SELECT DISTINCT, 498select queries. See also action queries;
aggregate queriesaction queries v., 56creating, 34–44defined, 33on multiple tables, 39–41operators in, 41–44
SELECT statement, 164, 165, 491–492,500
SELECT TOP PERCENT statement, 502SELECT TOP statement, 500–502SELECT...INTO, 217, 502
semicolons, 466, 468, 491separation, data/presentation, 7–8Series area (pivot charts), 314server application, 390SET, 503SetWarnings action, 211, 212, 217, 222,
230, 231, 263, 404Sgn function, 550shared processing, 9–10Show Table dialog box, 34, 35, 48, 491Simpson, Alan, 477simulating Mail Merge feature from
Excel, 452–456Sin function, 550Single, 16, 558, 559single criterion, 41, 144single quotes
comments and, 425SQL and, 381textual criteria and, 180, 265, 377
slide with title (PowerPoint),456–458
SlideTitle, 457, 459SLN function, 550‘‘SMALL’’ update value, 152, 153Social Security numbers, 21sorting
by capitalization, 102/filtering, for on-the-fly analysis,
33–34query results, 37–38reports, 279–282
Source, 368source data, report creation and,
283–284Space function, 551spaces
in field names, 15leading/trailing, 103LTrim function and, 103, 557RTrim function and, 103, 557Trim function and, 103, 557
586 Index ■ S
spaces (continued)object names and, 220
SQL (Structured Query Language),489–508. See also queries
advanced, 495–504aggregate functions, 551–552basic, 489–495data transfer processes (with
VBA/ADO), 365–387ADO fundamentals, 366–374ADO/SQL data extract, 374–376common scenarios, 380–387criteria in SQL statements,
376–379single/double quotes and, 381VBA, ADO, SQL one-two-three
combination, 365, 384, 387SQL statementsFROM, 379, 495action queries via, 502–503ADD, 506, 507ADD CONSTRAINT, 506, 508ALTER COLUMN, 506, 507ALTER TABLE, 506–508CREATE TABLE, 506DELETE, 503DISTINCT, 165, 496DISTINCTROW, 498DROP COLUMN, 506, 507GROUP BY, 165, 379, 498HAVING, 498INSERT INTO, 173, 263, 503Like operator and, 43, 378, 496–497ORDER BY, 499SELECT DISTINCT, 498SELECT statement, 164, 165, 491–492,
500SELECT TOP PERCENT statement, 502SELECT TOP statement, 500–502SELECT...INTO, 217, 502SET, 503subquery creation and, 165–168
TRANSFORM, 503–504troubleshooting errors, 378–379user-defined parameters and,
264–265as variables, 264WHERE clause, 492
wildcards and, 378SQL view, 164, 166, 167, 174, 263,
490, 491, 504, 505, 506, 507, 508SQL-specific queries, 504–508Sqr function, 552square brackets [ ]
aliases and, 125field names and, 15, 76, 125forms and, 255parameter queries and, 143wildcard, 496, 497
standalone attribute (XMLdeclaration), 425
standard modules, 478statistics. See descriptive statisticsSTATS macro, 238StDev function, 53, 551StopMacro, 217stored calculations, 113–114,
139–140Str function, 552–553StrConv function, 101, 553STRING function, 331–334, 344, 554strings
adding text in key positions,105–107
empty, 97. See also Null valuespadding, 107–108parsing, 109–112
StrReverse function, 554Structured Query Language. See SQLsubqueries, 163, 164–176, 186–187
in action queries, 173–174comparison operators and, 169correlated, 170–173, 192
Index ■ S–T 587
creating, SQL statements and,165–168
as expressions, 170ground rules, 165nesting and, 44, 164, 165, 186NOT IN operator and, 168–169, 175IN operator and, 168–169reasons for using, 165top values, 174–176uncorrelated, 171
subselect queries. See subqueriesSum function, 53, 551suppressing warning messages, 263Switch function, 141, 150, 156–158,
159, 554–555IIf function v., 157–158power of, 156quartile standings and, 201–202syntax, 156–157
switches, command-line, 238–240SYD function, 555symbols (for reports/queries),
335–339syntax, calculation errors and, 125
Ttable aliases, 171, 172, 499tables (Access tables), 10–11. See also
databases; pivot tablesADO/SQL data extract and,
374–376appending Excel records to,
384–386basics, 13–28creating, 17–19Customer_ListA, 62, 63defined, 13–14, 46Dim_Customers, 14, 15, 35, 39, 70,
164, 501, 502Dim_Transactions, 39–40, 74, 178,
179, 180
elements of, 14–15Excel. See Excelgraphics, 340, 341–342Holidays, 131–132importing data into, 22–26LeadList, 90, 92, 94, 95, 100, 111LeadList_NoDups, 94, 95LocationMaster, 226LoopList, 229, 230, 231MainSummary, 172, 396multiple, queries on, 39–41PvTblFeed, 180, 394, 395, 396RevenueSummary, 68, 69SalesHistory, 59, 61, 66, 67, 72tblJobCodes, 263TopTenList, 228, 229, 231TransactionMaster, 157, 197, 529,
530Tan function, 555Task Scheduler, 233–238tblJobCodes table, 263template (mail merge document), 448testing functions, 480Text (data type), 16, 18, 54, 552text boxes, 251, 252, 287text files, querying, 386–387textual criteria, 180, 377textual parameters, from form,
264–265Time function, 556. See also
Date/Time functionsTimeSerial function, 556TimeValue function, 460, 463, 556–557Top Values property, 174, 193, 194,
196, 197, 198, 229, 500, 501top values queries, 174, 193, 194, 196,
197, 198, 500–502SELECT TOP PERCENT statement, 502SELECT TOP statement, 500–502
top values subquery, 174–176TopTenB_Child macro, 230, 231, 232,
485, 486, 487
588 Index ■ T–V
TopTenList table, 228, 229, 231totaling reports, 279–282Totals dialog box, 281Totals row, 48, 49, 68–69trailing spaces. See leading/trailing
spacesTransactionMaster table, 157, 197,
529, 530TransferDatabase, 212, 217transferring data. See data transfer
processesTRANSFORM statement, 503–504transformation tasks. See data
transformationtransparency, of analytical processes,
5–6Trim function, 103, 557True/False field, 17. See also Yes/Notrusted databases, 211–213, 214, 216,
217, 218, 233trusted locations, 2132009_Projections, 137–138txtPath text box, 256type conversion failure, 64type mismatch in expression (error
message), 44TypeName function, 557–558
UUCase function, 101, 558uncorrelated subqueries, 171underscore character (_), 15, 76, 220,
367, 376, 426UNION operator, 504–505unique identifier, 30, 252, 427. See
also primary keysUnique Values property, 45, 73, 96update queries, 70–73, 85
case conversion and, 101concatenation and, 98–100creating, 70–72
expressions in, 72failures, 72–73hazards of, 70parsing and, 110–112reasons for using, 70subqueries in, 174UPDATE/SET and, 503
updateable datasets, 72–73upper camel case, 220User ID argument, 367user-defined parameters, 264–265utility, field as, 54
VVal function, 559validation rule violation, 64, 65VALUE, 154#VALUE error, 362value from previous record (domain
aggregate functions), 184–186Var function, 53, 552variables
assigning value to, 481–482connection strings and, 366declaring, 481defined, 481SQL statements as, 264
VarType function, 559–560VBA, ADO, SQL one-two-three
combination, 365, 384, 387VBA (Visual Basic for Applications),
12, 243–266, 477–488advantages of, 243, 260automation and, 12, 209background data processing,
260–265books
Beginning Access 2007 VBA, 477Excel 2007 VBA Programmer’s
Reference, 434
Index ■ V–W 589
custom functions, 244–251,265–266
data transfer processes (withADO/SQL), 365–387
ADO fundamentals, 366–374ADO/SQL data extract, 374–376common scenarios, 380–387criteria in SQL statements,
376–379functions
compiling, 482creating, 478–482defined, 478in forms, 484–485in macros, 483procedures and, 479–480saving, 482–483testing, 480
fundamentals, 477–488macros converted to, 485–488RunSQL statements, 261–265,
266VBA Editor, 253, 257, 258, 264, 485,
520VBE. See VBA Editorversion attribute (XML declaration),
424views. See specific viewsVisual Basic for Applications. See
VBAvisualization techniques, 323–344
advanced, 331–343conditional formatting, 326–331dashboard graphics, 323, 331, 334,
335, 339–343, 344data bars, 331–335number formatting (for reports),
324–326symbols, 335–339
VLOOKUP, 11, 31
WWarning field, 133, 134warning messages, suppressing, 263Weekday function, 130–132, 560WeekdayName function, 561WHERE clause, 378, 492Where clause, 54, 55–56wildcards
∗ (asterisk), 43, 146, 378, 415, 492,496, 497
? (question mark), 496, 497[ ] (square brackets), 496, 497parameters with, 145–146, 254,
415–416pound symbol (#), 496, 497WHERE clause and, 378
wiley.com, 169wiley.com/go/excelanalystguide,
228Windows Task Scheduler, 233–238wizards
Command Button Wizard, 252, 484Crosstab Query Wizard, 74–79Export wizard, 348–350, 363Find Duplicates Query Wizard, 91,
92, 93, 94Import Spreadsheet Wizard, 22–26Insert Function wizard, 118, 119Link Spreadsheet Wizard, 27–28Lookup Wizard, 16Microsoft Query wizard, 354, 357,
359Report wizard, 289Scheduled Task Wizard, 234
Word Object Library, 446Word/Excel integration techniques
dynamic link to Excel table,442–445
Excel data to Word (automation),445–448
590 Index ■ W–Z
Word/Excel integration techniques(continued)
simulating Mail Merge featurefrom Excel, 452–456
Word Mail Merge feature, 448–452WorkbooktoPowerpoint.xlsm, 462workdays/non-workdays, 131–132wrong data type for parameter (error
message), 45wrox.com, 189, 391
Xxlwksht, 462, 463, 464XML, 423–440
data entry process, 434–439data entry form in Excel,
435–436data entry schema in Access,
434–435exporting results from Excel to
XML, 436–437getting results into Access,
437–439declaration, 424–425documents
attributes, 427–428comments, 425components, 424–429
elements, 425–426namespaces, 428–429processing instructions, 425root element, 426–427
reasons for using, 423–424reporting solution, 429–434
exporting XML data from Access,429–431
utilize XML data in Excel, 432–434
YYear function, 130–132, 561Yes/No (data type), 11, 16, 17, 53
ZZalexCorp Restaurant Equipment
and Supply.accdb sampledatabase, 372, 373, 375, 376, 382,383, 391, 395, 412, 417, 418, 419,420
ZalexCorp sample database, 347,348, 355, 356, 357, 358
zerosdivision by zero (error message), 44Null values and, 123. See also Null
valueszip codes example, 70–71Zoom dialog box, 166, 175, 176