Can a collection be wrapped in access?
From: Hector Cabrera via AccessMonster.com (forum_at_AccessMonster.com)
Date: 02/08/05
- Next message: kirkrankin: "RE: Opening Access, every time it has to configure - Why?"
- Previous message: George H. Slamowitz: "Storing foreign Asian Languages in a table"
- Next in thread: onedaywhen: "Re: Can a collection be wrapped in access?"
- Reply: onedaywhen: "Re: Can a collection be wrapped in access?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 08 Feb 2005 14:27:19 GMT
Goodmorning ! Any help with this issue? How can I set the needed procedure
attributes in access to have a wrapped collection class and not loose the
"For Each...Next" functionality? Am I asking too much of access? This is
what I have in the class:
Option Compare Database
Event addItem(strId As String)
Event removeItem(strId As String)
Public myCol As Collection
Private Sub Class_Initialize()
Set myCol = New Collection
End Sub
Private Sub Class_Terminate()
Set myCol = Nothing
End Sub
Public Function Add(Value As Form) As clsParticipant
On Error Resume Next
Dim objItem As New clsParticipant
objItem.Name = Value("name")
objItem.Phone = Value("phone")
objItem.Email = Value("email")
objItem.Company = Value("company")
myCol.Add objItem, objItem.Name
Set Add = objItem
On Error GoTo 0
End Function
Public Sub remove(strName As String)
myCol.remove strName
End Sub
Public Function count() As Long
count = myCol.count
End Function
Public Function Item(ByVal varIndex As Variant) As clsParticipant
Set Item = myCol.Item(varIndex)
End Function
Public Function NewEnum() As IUnknown
Set NewEnum = myCol.[_NewEnum]
End Function
-- Message posted via http://www.accessmonster.com
- Next message: kirkrankin: "RE: Opening Access, every time it has to configure - Why?"
- Previous message: George H. Slamowitz: "Storing foreign Asian Languages in a table"
- Next in thread: onedaywhen: "Re: Can a collection be wrapped in access?"
- Reply: onedaywhen: "Re: Can a collection be wrapped in access?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|