Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 91 2

Status
Not open for further replies.

sfunk

Technical User
Jan 22, 2002
107
0
0
US
Hello

I wrote a component and this is the code that I am using to access the component.

I get this error
Run-time error '91'
object variable or With block not set


It then highlights the line in red


Private Sub Command1_Click()
Dim objCRJet As JetCompactRepair.CompactRepair
Dim strPath As String
strPath = "c:\test.mdb"
objCRJet.CRGo (strPath)
MsgBox "Success"
Set objCRJet = Nothing
End Sub

What am I missing?

Thank you...
Sincerely,
steve
 
You probably need to "Set" the variable first. Try:

Set objCRJet=New CompactRepair
 
Try this
Dim objCRJet As New JetCompactRepair.CompactRepair Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top