Print report from subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone -

I have a form with two subforms on it displayed through tabs. I also have a
report built. I want to have a button on one of the subforms that will print
the report for the specific record displayed on the subform. I've seen
several variations of this question on this discussion board but none seem to
completely fit my needs.

Any thoughts on the best way to accomplish this?

Many thanks in advance.
 
Use the "wherecondition" argument of the OpenReport method to restrict the
Report to just the CurrentRecord in the Subform. For example, if you have
CommandButton on the Subform, you can use something like:

DoCmd.OpenReport "MyReport", , , "[RecordID] = " Me.txtRecordID

Check Access VB Help on the OpenReport method for different argument you can
use.
 
Back
Top