Runtime Error 403: Class does not support Automation...

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top