I had the same problem. I think you do not need ADO or other chinese food. I found this and it works (provided Acces is installed on the running PC). Hope you can use it too:
first step: I made a new query in Access to select the records I need (doesn't matter how you name it)
second step: I made a report in Access based on this query - I called this report rptReport (must be the same name in the example code below)
third step: I use this code
first some variable explanation for this examples:
- rptReport = name of report in Access
- TABLE = table in database also used in query
- FIELD = field parameter you want to pass to the report, in this case an Integer
- Combobox = combobox on the form from wich the user can select to obtain the appropriate report
'example 1. in order to have the report printed immediately without preview:
Dim Acc As Access.Application
Set Acc = New Access.Application
Acc.OpenCurrentDatabase "C:\Path Database"
Acc.DoCmd.OpenReport "rptReport", acViewNormal, , "TABLE.FIELD=" & CInt(ComboBox.Text)
Acc.Visible = False 'not sure this is really needed
Set Acc = New Access.Application
'example 2. in order to have a preview of the report (you can then click the print icon to have it printed):
Dim Acc As Access.Application
Set Acc = New Access.Application
Acc.OpenCurrentDatabase "C:\Path Database"
Acc.DoCmd.OpenReport "rptReport", acPreview, , "TABLE.FIELD=" & CInt(ComboBox.Text)
Acc.Visible = true
Set Acc = New Access.Application
Important: in your query design, put no Criteria value in the TABLE.FIELD, you will just be passing the parameter value using the Acc.DoCmd.OpenReport statement, and the report will pass your parameter further upstream to the query in order to make the right selection
good luck
vincent
acady@yucom.be