G
Guest
Can I set a custom Collection object as the recordset for a listbox control?
My MS Access app uses class modules to return custom objects as follows:
=====
Private Sub Form_Load()
Dim objBLL As clsBLL, rsContacts As ADODB.Recordset
Dim colPatients As clsPatientList
Set objBLL = New clsBLL
Set colPatients = New clsPatientList
Set rsContacts = New ADODB.Recordset
Set rsContacts = objBLL.GetMasterListRS 'returns a recordset
Set colPatients = objBLL.GetMasterListCollection 'returns a collection
Set Me.lstPatients.Recordset = colPatients ' This generats error '403'
Set Me.lstPatients.Recordset = rsContacts ' This WORKS
Set objBLL = Nothing
Set colPatients = Nothing
Set rsContacts = Nothing
End Sub
=====
Is there a work-around for this?
Thanks.
Dan E.
My MS Access app uses class modules to return custom objects as follows:
=====
Private Sub Form_Load()
Dim objBLL As clsBLL, rsContacts As ADODB.Recordset
Dim colPatients As clsPatientList
Set objBLL = New clsBLL
Set colPatients = New clsPatientList
Set rsContacts = New ADODB.Recordset
Set rsContacts = objBLL.GetMasterListRS 'returns a recordset
Set colPatients = objBLL.GetMasterListCollection 'returns a collection
Set Me.lstPatients.Recordset = colPatients ' This generats error '403'
Set Me.lstPatients.Recordset = rsContacts ' This WORKS
Set objBLL = Nothing
Set colPatients = Nothing
Set rsContacts = Nothing
End Sub
=====
Is there a work-around for this?
Thanks.
Dan E.