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

Object inheritance question

Status
Not open for further replies.

mikej336

MIS
Feb 10, 2005
164
US
I have a some code that I need to put in a sub. It works fine in the body but when I move it to a sub I get "Not and object reference". Is there a way to pass the object inheritance to the a sub?

Dim objDocument As Document

If Len(objDocument.Forms.Item(objDocument.DocumentClass.BaseFormName).FormFields.Item(CurrentFieldName).Value)> 0 Then
FieldValue = objDocument.Forms.Item(objDocument.DocumentClass.BaseFormName).FormFields.Item(CurrentFieldName).Value
Else
FieldValue="N/A"
End If


Thanks Uncle Mike
 
Where is objDocument instantiated in your code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am using an imaging product with a Sax Basic macro language which is very close to VBA. It is difined in the main section, if that is helpful.

Uncle Mike
 
I attempted to declare it public but it gives me

"Unteminated block statement"

Thanks again

Uncle Mike
 
I figured it out... The interface starts you out in Sub out have to go above it to declare your public variables.

Thanks to all

Uncle Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top