This series of classes (320-329) is all about
Recordsets. Every class will focus on Recordset creation. Our goal
is to add Inventory Control (Products In, Products Out, and Purchase
Orders) to our PC Resale database that we've been building since
Access 101. In today's class we're going to start with the basics of
recordsets.
You will first learn what a Recordset is, how to create a
Recordset, different uses for Recordsets. In a nutshell, a Recordset
is a way to access the data and structure of a table or query from
Visual Basic programming. Knowing how to work with Recordsets opens up a
whole new world of possibilities for your database development.
You will learn about DAO, ADO, references,
and the different object libraries.
You will learn how to create a Recordset object
in VBA code to detemine information about your database.
You will learn how to create a Recordset to
loop through all of the records in a table.
You'll learn about variables and their
scope.
You'll learn how to create buttons to move around
inside a Recordset manually with MoveNext and MovePrevious.
We'll learn how to use a Recordset and the
FindFirst method to search for records inside of your table.
Access 320 - Course Outline
1. Recordset Basics
What is a Recordset?
Why use Recordsets?
Example Uses For Recordsets
Turn Off VBA Project Explorer
Tools > References
What is a Library?
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library
DAO vs. ADO, Brief Discussion
2. Our First Recordset
Create a Database Object
Create a Recordset Object
OpenRecordSet
db.Name, rs.Name
Closing Our Objects
Freeing Memory (Set to Nothing)
Creating a Status Box
Display Field Data: FirstName
When to use ! vs .
Ways to Refer to Fields
rs!Fieldname
rs("Fieldname")
rs(Index)
rs![First Name]
Create Unbound Text Boxes
Store RS Data Into Text Boxes
3. Moving Around, Part 1
MoveNext
MovePrevious
MoveFirst
MoveLast
Move X
EOF End of File
BOF Beginning of File
Endless Loops
Create a Counter
Dim Variables Outside of Subs
Variable Scope
Opening Recordset With Form Opened
Closing Recordset When Form Closed
4. Moving Around, Part 2
Buttons to Move Around Recordset
Dealing with Hitting EOF/BOF
RecordCount Property
5. Finding Records, Part 1
FindFirst
Types of Recordsets
dbOpenTable
dbOpenDynaset
dbOpenSnapshot
dbOpenForwardOnly
NoMatch
6. Finding Records, Part 2
Wildcard Search
Dynamic SQL For FindFirst
Do Loop
FindFirst
FindPrevious
|