Classes and Collections

N

Neal Ostrander

Could someone point me to some good tutorials on using classes and collections.
Thanks
Neal
 
P

perry

Straight from F1 Access help
Repost, if you have difficulties implementing below code in yr solution.

Krgrds,
Perry

'Access Help code
'=============
Sub ClassNamer()
Dim MyClasses As New Collection
Dim Num
Dim Msg As String
Dim TheName, MyObject, NameList
Do
Dim Inst As New Class1
Num = Num + 1
Msg = "Enter a name" & Chr(13) _
TheName = InputBox(Msg, "Name the items in the collection")
Inst.InstanceName = TheName
If Inst.InstanceName <> "" Then
MyClasses.Add item := Inst, key := CStr(Num)
End If
Set Inst = Nothing
Loop Until TheName = ""
For Each MyObject In MyClasses
NameList = NameList & MyObject.InstanceName & Chr(13)
Next MyObject
MsgBox NameList, , "names in collection MyClasses"

For Num = 1 To MyClasses.Count
MyClasses.Remove 1
Next
End Sub
 
Top