It's Access, stuuuupid ;)
Thanks for the help. When I run this with the filter option, where Filter = name of query, I am getting a popo-up message asking me to enter the parameter value.
DoCmd.OpenReport "R001-TEST REPORT", , "Q045-TEST REPORT", strCriteria
Here's my code
[html]
Private Sub Command2_Click()
Dim db As Database
Dim rs As Recordset
Dim strCriteria As String
Set db = CurrentDb
Set rs = db.OpenRecordset("T007-CPT SUMMARY") ' The aforementioned Table1
rs.MoveFirst
Do Until rs.EOF
strCriteria = "[CPT CATALOG NUMBER]=" & rs![CPT CATALOG NUMBER] ' put the name of the relevant field here, assumes a number datatype"
'DoCmd.OpenReport "R002-ORIGINAL COMPONENTS TABLE", , strCriteria, strCriteria
'DoCmd.OpenReport "R003-LOW USAGE FOR REPORT", , , strCriteria
'DoCmd.Close acReport, "R003-LOW USAGE FOR REPORT"
'DoCmd.OpenReport "R004-LESS THAN 10 COMPONENTS FOR REPORT", , , strCriteria
'DoCmd.Close acReport, "R004-LESS THAN 10 COMPONENTS FOR REPORT"
'DoCmd.OpenReport "R005-PREFERRED 2 FOR REPORT", , , strCriteria
'DoCmd.Close acReport, "R005-PREFERRED 2 FOR REPORT"
DoCmd.OpenReport "R001-TEST REPORT", , "Q045-TEST REPORT", strCriteria 'Opens the report
DoCmd.OutputTo acOutputReport, "R001-TEST REPORT", , , NO
' Prints the Report
'DoCmd.Close acReport, "R001-TEST REPORT" ' Closes the report
' DoCmd.OutputTo acOutputReport, "R002-ORIGINAL COMPONENTS TABLE", , , NO
'DoCmd.Close acReport, "R002-ORIGINAL COMPONENTS TABLE"
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
[/html]