Microsoft Access VBA Macro Programming

(Tina Sui) #1
message boxes, 66–69
in debugging, 89–90
See alsoMsgBox statements
methods, 176–178
calling, 180–184
Microsoft Graph 12.0 Object Library, 232
referencing, 231
Microsoft Office
driving Access from Office programs,
226–228
using Access to interact with other Office
programs, 221–224
Microsoft Outlook, driving, 224–226
Mid function, 46–47
Minute function, 61
Mod operator, 74
module-level variables, 16
modules
and events, 11
vs. macros, 3–4
overview, 27–28
See alsoclass modules
Month function, 61
mouse down event, 88
MoveFirst method, 211
MoveLast method, 211
MoveNext method, 155, 211
MovePrevious method, 211
MsgBox statements, 9–11
See alsomessage boxes
multidimensional arrays, 23
See alsoarrays
MyCode, 7–8

N
Name property, 206
NoMatch property, 211
Not operator, 76
Now function, 56
Null value, 19–20
numeric data types, 20–21
See alsodata types

O
oAApp object, 227
Object Browser, 184–186
Object Library, adding references to, 221–222
object models

CurrentDb object, 205–207
hierarchy of objects, 190–191
See alsoAccess object models;
Object Browser
objects
Application object, 193–201
creating, 267–268
creating in memory, 189–190
Me object, 201–205
Recordset object, 207–211
objects inventories, creating, 317–319
ODBC, 239–240
links and DSNs, 240–243
Office programs
driving Access from, 226–228
using Access to interact with, 221–224
On Error Resume Next statement, 94
Open File dialog, 124–125
OpenForm method, 111, 215
OpenQuery method, 215–216
OpenRecordset method, 206
OpenReport method, 216
OpenTable method, 216
operators
arithmetic, 72–74
comparison, 74
concatenation, 75
conditional, 38
logical, 75–79
miscellaneous, 79–80
order of precedence, 71
overview, 71–72
option buttons, 110
Optional keyword, 33
Or operator, 76–77
order of precedence, 71
oRSet object, 228

P
pass-through queries, 246–248
See alsoSQL queries
pausing code, 303
Picture property, 203
predefined Date and Time formats, 54
predefined formats, 53
Print dialog, 128
Printer property, 199, 203
Printers collection, 199
PrintOut method, 216–217

370 Microsoft Access 2010 VBA Macro Programming

Free download pdf