Print report from subform

A

axw99

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.
 
V

Van T. Dinh

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.
 
Top