AddAllToList() Function error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I followed the instructions in "Q210290 - ACC2000 How to Add '(all)' to a Combo Box or a List Box Control", but I consistently get a "Type Mismatch" error. The line of code that appears to be generating the error is "Set RS = DB.OpenRecordset(C.RowSource, DB_OPEN_SNAPSHOT)". The combo box is Unbound on a form I'm using to set criteria in a query for use in a report. I have managed to use a Union Query to get "All" to appear in the combo box, but it does not allow all records from the query to pass through to the report. Can anyone help me with this?
 
Set RS = DB.OpenRecordset(C.RowSource, DB_OPEN_SNAPSHOT)".

Make sure you have DAO selected in References. Also try declaring rs as

Dim rs as dao.recordset

-- Dev
 
Thank you for the help. Declaring the DAO.Recordset solved my problem.
I am having another problem with the same form. I am using the combo box with "All" in it as the criteria in a query that filters records for a report. When I select "All" from the combo box, I get no records. Can you tell me how I might solve this? Thanks again.
 
Back
Top