Print Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Engineer Clement
    New Member
    • Nov 2008
    • 3

    Print Report

    Hi,
    kindly direct me on what to do
    I have a form and a report.
    On the form, I have a print button.
    When I click the print button, I want it to print only my focus on the report. i.e if I am on serial no 4 on the form, in the report, it should print only content of serial no 4 and not every thing.
    Thank U.
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Assuming that SerialNo is in a textbox control on your form named "txtSerialN o". You need to replace the object names that I used for illustrative purposes with their actual names in your application.

    If serial no is a numeric datatype:
    Code:
    DoCmd.OpenReport "yourReportName", acViewPreview , , "[SerialNo] = " & Me!txtSerialNo

    If serial no is a text datatype:

    Code:
    DoCmd.OpenReport "yourReportName", acViewPreview , , "[SerialNo] = '" & Me!txtSerialNo & "'"

    Comment

    Working...