Navigate a Recordset With a Userform – Part I

This is the first of a four-post series that will describe how to connect a Userform to an ADO Recordset. The end result will be similar to an Access form where you can go to the previous record, next record, etc. It will not show how to update the recordset, although if I’m feeling froggy, I might add a Part V.

Part I – Set up the userform
Part II – Special purpose Sub procedures
Part III – Set up the Recordset
Part IV – Code the buttons to navigate the Recordset

Set Up The Userform

ufado1

Set up this userform: ufEmployee, Caption = Employees

From top to bottom, left to right, set up these controls

  • tbxEEID, Tag = Field0
  • tbxLastName, Tag = Field1
  • tbxFirstName, Tag = Field2
  • tbxBirthDate, Tag = Field3
  • tbxHireDate, Tag = Field4
  • cmdFirst, Caption = < <, Tag = ButtonFirst
  • cmdPrev, Caption = <, Tag = ButtonPrev
  • cmdNext, Caption = >, Tag = ButtonNext
  • cmdLast, Caption = >>, Tag = ButtonLast

Now save this workbook and tune in for Part II where we’ll create a couple of special purpose procedures to manage the Userform.

One thought on “Navigate a Recordset With a Userform – Part I


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.