steveouthwaite
Programmer
Hi,
I am trying to store some data in a collection.
What I want is to access the info such as:
a = collection (index).name
b = collection (index).cat1
I have set a variable to a User Defined Type, assigned the data, then added this to the collection
In a module...
Public type riskassessment_type
name as string
cat1 as string
cat2 as string
End type
public ra_temp as riskassessment_type
public riskassessment_collection as new collection
in a form...
ra_temp.name = "test1"
ra_temp.cat1 = "testcat1"
ra_temp.cat2 = "testcat2"
riskassessment_collection.add ratemp,ra_temp.name
an error is generated at "riskassessment_collection.add..."
"only user defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions."
Unfortunately MSDN just repeats that error message.
Anyone know what's going on?
thanks in advance,
Steve
I am trying to store some data in a collection.
What I want is to access the info such as:
a = collection (index).name
b = collection (index).cat1
I have set a variable to a User Defined Type, assigned the data, then added this to the collection
In a module...
Public type riskassessment_type
name as string
cat1 as string
cat2 as string
End type
public ra_temp as riskassessment_type
public riskassessment_collection as new collection
in a form...
ra_temp.name = "test1"
ra_temp.cat1 = "testcat1"
ra_temp.cat2 = "testcat2"
riskassessment_collection.add ratemp,ra_temp.name
an error is generated at "riskassessment_collection.add..."
"only user defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions."
Unfortunately MSDN just repeats that error message.
Anyone know what's going on?
thanks in advance,
Steve