Printing a Single Selected Record from a Query of multiple

C

Chris

Hi,

I have a form which creates dynamic query that allows me to search 26
seperate fields in any combination. I usually get numerous results from my
query. I'd like to print a report of a single record I find using the query.

In essence, single out a record from the group of found records then print
that using a predefined report.

Is there a way to set up something similar to "Filter by selection" to allow
me to send the single record I select to a report?

Thanks,

Chris
 
J

Jeff Boyce

Chris

When you get your results, how do you get them? Are they simply a query
result, or are they somehow listed in a form (e.g., a subform, a listbox,
....).

If the latter, you could select/highlight the record you want to send to the
report, then use a command button to open the report.

In the code behind the button, you'd include the WHERE (or the Filter)
parameter, pointing to the recordID of the record selected on your form.
 
M

Michael J. Strickland

Chris said:
Hi,

I have a form which creates dynamic query that allows me to search 26
seperate fields in any combination. I usually get numerous results from my
query. I'd like to print a report of a single record I find using the query.

In essence, single out a record from the group of found records then print
that using a predefined report.

Is there a way to set up something similar to "Filter by selection" to allow
me to send the single record I select to a report?

Thanks,

Chris

Don't know if this is what you are looking for, but you could create a
secondary query using the generated query as the source and setting criteria
to select the record you want. Then use that secondary query as the source
for your report.


--
 
C

Chris

Thanks, I found a similar post, ended up using the code...

Me.Refresh
DoCmd.OpenReport "Physical Properties Search Report", acViewPreview, , "id =
" & Me!ID
 
Top