AddAllToList() Function error

C

Chris Barry

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?
 
D

Dev Ashish

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
 
C

Chris Barry

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.
 

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