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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object variable or With block variable not set

Status
Not open for further replies.

rmtiptoes

IS-IT--Management
Mar 30, 2004
55
US
Please help. I am trying to print a barcode by calling a barcode application and printing the number thru a test label formated for a Zebra printer. I have read the docs and continue to get the "Object variable or With block variable not set" error when I open the form. The application is getting called but it failes at the "Set MyDoc" line. What am I doing wrong? I have tried this two ways (actually 5,000 ways but I've narrowed it down)

First Way
Option Compare Database

Dim MyApp As Object
Dim MyDoc As Object

Private Sub Form_Load()
Set MyApp = New LabelManager2.Application
Set MyDoc = MyDoc.Documents.Add("My Documents\Mylan Documents\test.lab")
MyApp.EnableEvents = True

End Sub


Second Way
Option Compare Database

Dim MyApp As Object
Dim MyDoc As Object

Private Sub Form_Load()
Set MyApp = New LabelManager2.Application
Set MyDoc = MyDoc.Documents.Add("My Documents\Mylan Documents\test.lab")
MyApp.EnableEvents = True

End Sub
 
Thank you for your quick response. Unfortunately, that did not work. I received the same error at that protion of the code. Anything else?

Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.

 
Sorry. That DID work!!! Thanks a million!!!!

Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top