Ken expressed precisely :
> Garry
> EmpList is a collection of Employees. Employees is a collection
> defined in my Class module as something with a few properties
> including badge number, first and last name, and a bunch of man hour
> fields. E is short lived employee that comes from a chunk of data and
> is added to the collection if and only if it is not already a member
> (badge number exists) of the collection. I use this technique a lot
> to simply get a unique list of something. It works great, resuming
> next and generating a unique collection; until I try to skip a couple
> other steps like putting the skipped name in a listbox. There is no
> code, or at least no code that I am aware of, to the EmpList.Add. It
> is the method for adding to a collection that exists simply by virtue
> of EmpList being a collection.
> Ken
>
>
>
> On Jul 8, 10:09*am, GS <g...@somewhere.net> wrote:
>> Can you show the code for EmpList.Add()?
>>
>> Also, why are you resetting E each time? Seems to me that this might be
>> causing some conflict since I don't see the connection between Employee
>> and EmpList.
>>
>> --
>> Garry
>>
>> Free usenet access athttp://www.eternal-september.org
>> ClassicVB Users Regroup! comp.lang.basic.visual.misc
Ken,
Thanks for the details. This is what I expected and so was trying to
figure out if the problem lies in executing the Add method, OR if it
has to do with the ListBox. I can only guess as to where the ListBox is
(in a userform or worksheet) and that makes it hard to understand
exactly what's going on.
I reproduced the Employees collection and was able to add new members
as you were doing. I repeated a member that already existed and it
worked as expected (ie: didn't add the member to the ListBox. I don't
seem to be able to reproduce the problem using a ListBox on a userform.
Haven't tried using one on a worksheet, though.
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc