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

User-Defined Type error

Status
Not open for further replies.
Apr 8, 2002
8
CA
I am new to VBA, and was passed some code to start looking through so we can create a Word mail merge invoice with a details section. This partial code was pulled straight out of a book, so I don't know why this isn't compiling properly. Errata what? I am using Word 2002.
The first 5 lines are throwing the error "user-defined type not defined".

Function CreateTableFromRecordset( _
rngAny As Word.Range, _
rstAny As ADODB.Recordset, _
Optional fIncludeFieldNames As Boolean = False) _
As Word.Table

Dim objTable As Word.Table
Dim fldAny As ADODB.Field
Dim varData As Variant
Dim strBookmark As String
Dim cField As Long


Appreciate the advice!
Chad

 
Which application will this run under? I think you need to set the proper References (under Tools-References), especially to ADODB (whatever that is).
Rob
 
That did it! I wasn't including references to ADO.
Thanks for the direction Rob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top