?
Solved

Runtime Error : 91

Posted on 2004-10-18
1
Medium Priority
?
171 Views
Last Modified: 2010-05-02
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)
    rs.MoveFirst
    Do While Not rs.EOF
        i = rs.Fields(0)
        a = rs.Fields(1)
        MsgBox i & " ** " & a
    Loop
End Sub
0
Comment
Question by:sbhanja
1 Comment
 
LVL 26

Accepted Solution

by:
EDDYKT earned 1000 total points
ID: 12337416
change

Dim obj As HDSearch.SearchHDCallAction

to

Dim obj As new HDSearch.SearchHDCallAction
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question