Use the Where argument of the OpenReport method. You identify a field that
will have a unique value in the field. This is usually the table's primary
key. It is the fourth argument of the method:
Docmd.OpenReport "ReportName", , , strWhere
Now, to get the value in the strWhere variable, you may consider using a
combo box on you form that will return the value. So strWhere needs to look
like an SQL WHERE clause without the word where. Say your report's recordset
primary key field is named ClientID and you have a combo on the form that
returns ClientID and ClientName and the ClientID column is the bound column.
it would be like:
strWhere = "[ClientID] = " & Me.cboClientSearch

Signature
Dave Hargis, Microsoft Access MVP
> I would like to have a little form that filters by selection a particular
> record, then have a command button that selects that record in a report and
> then prints the record. Or is there a better way? I can get the form and
> filter to work, but how do you do the calling of the record in the report and
> then print only that one record? Thanks so much!!!!
Golfinray - 21 Apr 2008 18:40 GMT
As usual, Dave, "You the man!"
> Use the Where argument of the OpenReport method. You identify a field that
> will have a unique value in the field. This is usually the table's primary
[quoted text clipped - 16 lines]
> > filter to work, but how do you do the calling of the record in the report and
> > then print only that one record? Thanks so much!!!!