Results 1 to 2 of 2

Thread: Code question

  1. #1
    Join Date
    Dec 2011
    Posts
    7

    Unanswered: Code question

    I have a form called operator's log on Ms access and i have a code to print the report to file, the issue im having is that it prints to file with the file name and all but everytime it prints to file it prints all the records from that form, , all i want to to print the current record on the form that is all, any help with this or tips will be appreciated, i'm very new to access.
    here is the code :

    Private Sub Command17_Click()

    Me.Refresh

    Dim stDocName As String

    stDocName = "rptOperator Log"
    DoCmd.OpenReport stDocName, acNormal
    DoCmd.OutputTo acReport, stDocName, acFormatPDF, "L:\Operations\Team Managers\" & DatePart("yyyy", Date_of_Log) & " Operator Log\Employee Name " & Employee_Name & ".pdf"

    Exit_Command17_Click:
    Exit Sub


    Err_Command17_Click:
    MsgBox Err.Descriptionq
    Resume Exit_Command17_Click

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    3 ways. 1 is to use this to open the report in preview mode and then output:

    Open a second form to the record

    The second is to base the report on a query that gets a criteria from the form. Third is to filter the report from within:

    Emailing a different report to each recipient
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •