Runtime Error : 91

I have a VB project HDSearch with Class SearchHDCallAction, the DLL of which is generated and in the same machine. the method SearchHDSeverity_QueryRecord in this class accepts an integer parameter and returns a recordset. Trying to execute this from a standalone VB form gives the error 'Object variable or With block variable not set'. Please help.

Private Sub SrchSeverity_Click()
    Dim obj As HDSearch.SearchHDCallAction
    Dim rs As New ADODB.Recordset
    Set rs = obj.SearchHDSeverity_QueryRecord(20)
    Do While Not rs.EOF
        i = rs.Fields(0)
        a = rs.Fields(1)
        MsgBox i & " ** " & a
End Sub
Who is Participating?
EDDYKTConnect With a Mentor Commented:

Dim obj As HDSearch.SearchHDCallAction


Dim obj As new HDSearch.SearchHDCallAction
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.