Option Compare Database
Option Explicit
Dim Coll As New Collection, lKey As Long, Key As String
Public Sub Add(S)
lKey = lKey + 1
Key = "X" & Format(lKey, "000000")
Coll.Add S, Key
End Sub
Public Sub Remove(S)
Dim I As Long
For I = 1 To Coll.Count
If Coll.Item(I) = S Then
Coll.Remove I
Exit For
End If
Next
End Sub
Public Sub Clear()
Dim I As Long
For I = 1 To Coll.Count
Coll.Remove 1
Next
lKey = 0
End Sub
Property Get Exists(S) As Boolean
Dim I As Long
Exists = False
For I = 1 To Coll.Count
If Coll.Item(I) = S Then
Exists = True
Exit For
End If
Next
End Property
Gruß aus dem Norden
Reinhard
Bitte immer die Access-Version angeben
geschrieben von Reinhard Kraasch , 21.11.2004, 23:02 Uhr , 32 mal gelesen