[AccessD] ...collections guru?

jwcolby jwcolby at colbyconsulting.com
Wed Feb 17 15:40:22 CST 2010


Collections hold variants, and can therefore hold pointers to objects such as text boxes or fields.

Thus if you (for example) feed the collection MyTextBox guess what is placed in the collection?

Yep, the text box itself.

If you feed it rst("SomeField") guess what is placed in the collection.

Yep, the FIELD itself.

You need to be careful to always use syntax like MyTextBox.Value or rst("SomeField").Value so that 
the actual VALUE of the text box (or field) is placed in the collection, and not the textbox object 
or field object.

If you really need to you CAN place the text box itself or the field itself into the collection, but 
just understand when you go to retrieve the contents from the collection, that you are dealing with 
the object itself and not the VALUE that was in the object.

John W. Colby
www.ColbyConsulting.com


William Hindman wrote:
> ...thanks JC ...that turned out to be a minor nit in the code ...the real 
> problem was that for some bizarre reason the collection didn't treat the 
> records as text ...I could count the records in the collection but couldn't 
> read them ...Max suggested I load them as a string and that cured the 
> problem :)
> 
> William




More information about the AccessD mailing list