So I'm getting this error when I click a command button on a form:
Run-time error '91': Object variable or With block variable not set
When I click 'debug,' the line that lights up is the following:
This would seem to mean that I hadn't properly set up rsContacts.
But in General Declarations for the form include this:
And the Private Sub Load() procedure for the form includes this line:
And one of my available references is the Microsoft ActiveX Data Objects 2.8 Library.
So what am I doing wrong?
p.s. The code I'm using appears in section 5.2.4.5.3 of the book Beginning Access 2007 VBA, by Denise Gosnell.
Run-time error '91': Object variable or With block variable not set
When I click 'debug,' the line that lights up is the following:
Code:
If Not rsContacts.BOF And Not rsContacts.EOF Then
This would seem to mean that I hadn't properly set up rsContacts.
But in General Declarations for the form include this:
Code:
Dim rsContacts As ADODB.Recordset
And the Private Sub Load() procedure for the form includes this line:
Code:
Set rsContacts = New ADODB.Recordset
And one of my available references is the Microsoft ActiveX Data Objects 2.8 Library.
So what am I doing wrong?
p.s. The code I'm using appears in section 5.2.4.5.3 of the book Beginning Access 2007 VBA, by Denise Gosnell.