Hey,

I have a VBA program in Access and I just created a new function.
I want it to return a collection of objects that I create inside the function.

Code:
Private Function GetADPOrderDetails(OrderID As Long, AgencyID As Long) As Collection
    Dim blah As New Collection
    Dim rs As Recordset
    Dim sSQL As String
    
         
    'some code
    
    rs.Close
    Set rs = Nothing
    GetADPOrderDetails = blah
End Function
I am getting an argument not optional error and the GetADPOrderDetails = blah line is highlighted.

Can I not return collections in Ms-Access?

Thanks,