@Gasman,
Sorry I may have made this harder than necessary.
I prefer to do it this way and have it so that the Form just needs to know which command button was pressed and have the form then react to that. So all the code to locate a record remains in the form. The custom class just reports back to the form which button was clicked. This makes it more reusable and loosely coupled. Although that is a better design it probably much more confusing.
Instead if you have the class do all of the locating of the record (put the locating code in the class) then you do not have to report back to the form. You do not have to raise any custom events. This would make implementation easier. The clsAlphaCmd would trap the command button event and move the form. Then in the form all you need is a collection to hold all of the instances. The form does not have to react to any events since the location code resides in the class itself. This is more tightly coupled, but a lot easier to understand how to implement.
1. Where do you put Locate Record code?
In my approach I wanted to make it loosely coupled and kept that in the form. I had the form listen for the click event raised in my collection class
The simpler approach and what you started, it would need to be in the class.
2. Why did I convert iAlpha to string?
When you add anything to a collection you have the following parameters
object.
Add item,
key,
before,
after
The Key is a string. Now access is good at casting things so you probably could make the key a number but it will cast it to a string, anyways.
3. Why did it not compile with the .Name?
That was my fault. As I said I normally cut and paste the Collection Class and do some modification. Normally the thing I am adding to the collection class has a Name property and I use that as the key. Then you can return the object you need from the collection using the name.
In the collection class I usually have 2 methods to add to the collection. In the first you pass in the parameters and it builds and instance and adds to the class. The second method allows you to build an instance of some class and add to the collection.
So I will do a simpler example that does not require the collection class.