user-define type not defined - Dim itemInfo As Info

robben

Registered User.
Local time
Today, 07:58
Joined
Jan 27, 2008
Messages
52
Hi,

I have the following function. When I try and I compile it it stops at the following line "Dim itemInfo As Info" giving the following error messgae "compile error: user-define type not defined". I'm not sure what I'm doing wrong, would anyone have any suggestions? Thanks

Private Function FillObjectList(ctl As Control, varID As Variant, _
varRow As Variant, varCol As Variant, varCode As Variant) As Variant

' List filling function for lboObjects.
' Fills the list box with a list of
' the database container objects.

Dim varRetVal As Variant
Static sintRows As Integer
Dim itemInfo As Info <-------------------- ISSUE WITH THIS LINE -----

varRetVal = Null

Select Case varCode
Case acLBInitialize
' Fill mcolInfo with a list of
' database container objects
Set mcolInfo = New Collection
sintRows = FillObjArray()
varRetVal = True
Case acLBOpen
varRetVal = Timer

Case acLBGetRowCount
varRetVal = sintRows

Case acLBGetColumnCount
varRetVal = 4

Case acLBGetValue
' varRow and varCol are zero-based so add 1
Set itemInfo = mcolInfo(varRow + 1)
Select Case varCol
Case 0
varRetVal = itemInfo.ObjectType
Case 1
varRetVal = itemInfo.ObjectName
Case 2
varRetVal = itemInfo.DateCreated
Case 3
varRetVal = itemInfo.LastUpdated
End Select
Case acLBEnd
Set mcolInfo = New Collection
End Select

FillObjectList = varRetVal

End Function
 
What's Info?

I'm guessing this is a bit of code you have copied from somewhere else. If so, there's no doubt a Class Module that goes with it, called Info. If you don't have this, the code won't work.
 
Thanks for that
 
Create a new Module and Call it UDT

add the following
Code:
Public Type Info
    ObjectType as Integer
    ObjectName as String
    DaterCreated as Date
    LastUpdated as Date
End Type
 

Users who are viewing this thread

Back
Top Bottom