Alright here's the setup.
I have a class called GTSDAO which has a method on it called "OpenRecordset".
Code:
Public Function OpenRecordset(SQL As String, Optional dbType As RecordsetTypeEnum = dbOpenSnapshot, Optional dbOptions As RecordsetOptionEnum = dbSQLPassThrough) As Recordset
Set OpenRecordset = db.OpenRecordset(SQL, dbType, dbOptions)
End Function
The db object in the class is a DAO database created with an ODBC connection string set elsewhere. This way I can run all of my SQL requests directly to the SQL Server and bypass the JET engine entirely. No linked tables or local queries at all. Everything is VBA. I'm doing this for various reasons that I won't get into here.
Now I am trying to set the recordset for one of my listboxes to a recordset based on this "OpenRecordset" method.
Code:
SQL = "SELECT Customers.ID, CustomerName AS [Customer Name], Contacts.FullName AS [Contact Name], SQPhoneNumbers.PhoneNumber AS Phone," _
& " StatusName AS Status, iif(InActive = 0, 'Yes', 'No') AS Active" _
& " FROM ((((Customers LEFT JOIN CustomerDetails ON Customers.ID = CustomerDetails.CustomerID)" _
& " LEFT JOIN Contacts ON CustomerDetails.PrimaryContactID = Contacts.ID)" _
& " LEFT JOIN Customers_PhoneNumbers ON CustomerDetails.CustomerID = Customers_PhoneNumbers.CustomerID)" _
& " LEFT JOIN (SELECT ID, PhoneNumber" _
& " FROM PhoneNumbers WHERE [Primary]=1) AS SQPhoneNumbers" _
& " ON Customers_PhoneNumbers.PhoneNumberID = SQPhoneNumbers.ID)" _
& " LEFT JOIN CustomerStatuses ON CustomerDetails.CustomerStatusID = CustomerStatuses.ID" _
& " WHERE CustomerName LIKE '" & letter & "%' AND CustomerName LIKE '%" & Me.txtCriteria & "%'" & IIf(chkShowInActive, "", " AND InActive=0")
Set Me.lstCustomers.Recordset = db.OpenRecordset(SQL)
The query works fine when I run it in SSMS, I get 2 results back. However my listbox is blank. I have even checked the recordset of the listbox and it says there are 2 records in the listbox recordset. How can there be 2 records in my recordset, but the listbox shows nothing?

BTW, I did try switching over form dbSQLPassThrough to dbReadOnly and Access chokes on my subquery (SELECT ID, PhoneNumber FROM PhoneNumbers WHERE [Primary]=1) AS SQPhoneNumbers.

That is my listbox upon opening. It clearly thinks there are headers because it gives all of the widths for each header... but no data. Not even header data.