Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    3

    Question Unanswered: Report generating all reports no related id?

    Hi Guys and Girls,

    Thanks for your help in advanced!

    I'm trying to get a Pdf to export based on the Booing form ID as you can see below the argument has the Where condition in the wrong place (I'm guessing). Where (no pun) should I place it?

    Code:
    Private Sub btnCBFSignOff_Click()
    If DocumentSupplyID >= 1 Then
    strFilePathAndFile = "C:\Users\William\Dropbox\Buisness\WC-Media Ltd\Accounts\Clients\Awaiting Signatory\CBF 2 Sign\"
    DoCmd.OutputTo acOutputReport, "rptCBF", acFormantPDF, strFilePathAndFile & PDFLink & "CBFID." & [BookingFormID] & ".pdf", "BookingFormID = " & Me.BookingFormID
    Else
    MsgBox "WARNING: You have not supplied a document supply ID. Please select the relvant documents and re-submit!"
    End If
    End Sub

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    So what is going wrong, what is the problem
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Im guessing its the confusion between documentsupplyid and bookingformid
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    As answered elsewhere, not long after you asked:

    The argument is in the wrong place because OutputTo has no such argument.

    Options include opening the report in preview mode with the wherecondition (can be hidden), then outputting, then closing the report, or a technique like this to let the report filter itself:

    http://www.granite.ab.ca/access/emai...recipients.htm

    I lean towards the second, particularly in loops, to prevent the overhead of opening/closing the report, but you might not see a performance difference.
    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
  •