Microsoft Access VBA Macro Programming

(Tina Sui) #1
errors
compile errors, 81–82
generating your own, 94–95
logic errors, 82
runtime errors, 82
Type Mismatch errors, 73
See alsodebugging
events
Activate, 112, 121
After/Before Delete Confirm, 112
After/Before Insert, 112–113
After/Before Update, 113
Click, 113, 121
Close, 113, 121
Current, 113, 121
on forms, 111–112
Load, 113, 121
and modules, 11
Open, 113, 121
Print, 121
on reports, 120–121
Timer, 114, 122
using to create audit trails, 290–292
Excel
allowing users to design their Exel reports,
333–335
transferring individual numbers to Excel,
332–333
using a recordset to create a spreadsheet,
329–330
using an existing spreadsheet as a template,
330–331
Excel Object Library, adding references to, 329
Execute method, 206
ExecuteMso method, 140
Exit statements, 43
See alsolooping
explicit declaration, 14–15
Explosion property, 236

F
Field objects, 176
fields
deleting, 314
editing field properties, 315
See alsotables
Fields collection, 209
file size limit, 343–344
File Transfer Protocol.SeeFTP

Filter property, 203
FindFirst method, 209
FindLast method, 210
FindNext method, 210
FindPrevious method, 210
For Each loops, 41–42
format characters, 56
Format function, 52–56
forms
animation, 273–275
buttons, 108–109
check boxes, 109
creating a simple form, 98–100
datasheet view, 104–106
images, 109
list boxes, 109
making controls interactive, 349–353
making the form look professional, 106–107
option buttons, 110
overview, 97
relational fields, 100–102
subforms, 102–104
Tab Control, 110
using a custom ribbon, 107
using events, 111–114
using VBA, 111
Forms collection, 198
formulas, using in reports, 117–119
For..Next loops, 40–41
FTP
overview, 337
semaphore files, 340–341
using VBA code to transfer files, 338–340
functions
commonly used, 49–51
conversion functions, 51–52
date and time functions, 56–62
public or private, 32
vs. subroutines, 28–29
using custom functions within SQL queries,
163–164
writing a simple function, 30–32
See also individual functions

G
GetEnabledMso method, 140
GetImageMso method, 140
GetLabelMso method, 140
GetPressedMso method, 140

368 Microsoft Access 2010 VBA Macro Programming

Free download pdf