Microsoft Access VBA Macro Programming

(Tina Sui) #1

Private keyword, 32
procedure stepping, 85
Project Explorer, 6–8
Project trees, 6
properties, 176–178
manipulating read/write properties,
178–179
Public keyword, 32


Q


queries
creating a new query, 293–294
deleting an existing query, 294, 298–299
search and replace in queries, 299–300
searching for a specific string within all
queries, 297–299
updating a SQL query, 294–295
See alsoSQL queries
Query Design window, 150–154
QueryDefs collection, 207
Quit method, 199, 217


R


RecordCount property, 211
Recordset object, 186–188, 207
AddNew method, 208
BOF property, 208
Close method, 208
Delete method, 208
Edit method, 209
EOF property, 209
Fields collection, 209
FindFirst method, 209
FindLast method, 210
FindNext method, 210
FindPrevious method, 210
MoveFirst method, 211
MoveLast method, 211
MoveNext statement, 211
MovePrevious method, 211
NoMatch property, 211
RecordCount property, 211
Requery method, 211
Update method, 211
RecordSource property, 203
ReDim statements
and arrays, 22, 23
and local variables, 15–16
References collection, 199


Refresh method, 203
relational fields, 100–102
ReleaseFocus method, 140
Repaint method, 203–204
Report Wizard, 114–116
reports
creating a simple report, 114–116
keeping the report tidy, 116–117
overview, 114
using a custom ribbon, 119–120
using formulas, 117–119
using VBA, 120
Reports collection, 199–200
Requery method, 204, 211
reserved words, 26
Resume statement, 93–94
ReturnUserName function, 290
RibbonName property, 204
ribbons
creating a ribbon customization, 130–132
creating code for custom buttons, 136–138
creating menu structures with the ribbon,
345–348
editing using the Custom UI Editor,
132–136
further customization, 141–147
images, 138
overview, 129–130
using a custom ribbon on a form, 107
using a custom ribbon on a report, 119–120
using VBA code, 138–140
Right function, 47
RunCommand method, 217
running code, 9–10
runtime errors, 82
runtime mode, 82

S
Save File As dialog, 126
saving code, 12
Screen object, 200
ScrollBars property, 204
Second function, 61
security
locking databases, 284–287
locking projects, 283
setting up levels of user security, 355–357
using an ACCDE file to protect your
application, 283–284

Index 371

Free download pdf