Print results of a search form

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I created a search form using the tip from Allen Browne. It works great, but
i would like to print the results of the search. Can I use a command button
so the user can print the result of the search? If so, what is the best way
to do this. I am very new to Access, so a little help would be appreciated.
Thanks.
 
Presumably we are talking about:
http://allenbrowne.com/ser-62.html

Create a report that has the same source query as your form.
Lay it out the way you want it to print.
Save it as (say) rptSearchResult.

Add a command button to your search form.
In the button's click event procedure, copy the code from cmdFilter_Click.
At the end of the code, replace these 2 lines:
Me.Filter = strWhere
Me.FilterOn = True
with:
DoCmd.OpenReport "rptSearchResult", acViewPreview, , strWhere

Use acNormal instead of acViewPreview if you want it to go straight to the
printer.
 
Back
Top