Hi Jim,
Need a little more info.
How are you selecting the records you need printed (i.e., what controls are you using)? What field values are you using as your selection criteria? Are you selecting a single criteria or multiple criteria? Is the record source for your report a saved query, or are you building your SQL dynamically? Have you set parameters in a query that reference controls on the form, or are you using the reports filter property, or the WhereCondition argument of DoCmd.OpenReport? There's lots of ways to filter a report's record source. What does your data look like?
Using the WhereCondition approach is pretty straight forward. The bare-bones of it are something like this:
First, base your report on a query that contains the field(s) you are using as a criteria value to select records. Then,
Private Sub cmdPrint_Click()
Dim strCriteria As String
' Pull your report criteria from a control on the form
strCriteria = "[MyField] = " & Me.cboMyComboBox
DoCmd.OpenReport "MyReport", acNormal, , strCriteria
End Sub
You don't have to set any parameters in the query itself using this approach, though that's another way to go.
What's your setup look like so far? Post a little VBA and/or SQL if you can.
HTH,
Bob
|