Run time error 91 Object variable or .. - TechRepublic
General discussion
January 29, 2003 at 07:54 PM
hurdk

Run time error 91 Object variable or ..

by hurdk . Updated 23 years, 3 months ago

Hello,

I am having difficulty resolving the set instruction below.

I get runtime error 91 object variable or with block variable not set

I have tried many ways of handling this.

Public Sub LoadFindCbo()
Dim db As Database
Dim rs As Recordset
Dim sql As String
frmFind.cboCode.Clear
sql = “Select distinct code from PersonnelCommon order by code”

Set rs = dbEFC.OpenRecordset(sql) ‘ e r r o r

If rs.RecordCount > 0 Then
rs.MoveFirst
Do While rs.EOF = False
frmFind.cboCode.AddItem NoNull(rs!code)
rs.MoveNext
Loop
End If
rs.Close
End Sub

Thank you.

This discussion is locked

All Comments