Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem With Enter Parameter Value? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a unbound Report with a SubReport that has the following RecordSource:

    When I Print with DoCmd.OpenReport strDocName, acPreview the report prints perfectly to the screen after entering the Date Range dialog

    Then I select File and Print, Now Printing displays then Enter Parameter Value dialog ask me for the Date Range again

    If I enter the Date Range again the report prints OK

    How can I eliminate having to enter Date Range twice?

    Thank, John


    <pre>SELECT tbl_RevTran_Master.lngRevTranID, tbl_RevTran_Master.lngTranSeqNo,
    tbl_RevTran_Master.strProfileCode, tbl_RevTran_Master.strDeposit,
    tbl_RevTran_Master.strCollectorCode, tbl_RevTran_Master.dtmRevDate,
    tbl_RevTran_Master.dtmTime, tbl_RevTran_Detail.lngID,
    tbl_RevTran_Detail.strTranCode1, tbl_RevTran_Detail.strTranCode2,
    tbl_RevTran_Detail.lngRevGLDescID, tbl_RevTran_Detail.strSenior,
    tbl_RevTran_Detail.strYearFrom, tbl_RevTran_Detail.strRefNo,
    tbl_RevTran_Detail.strTranDesc, tbl_RevTran_Detail.lngCount,
    tbl_RevTran_Detail.curPrice, tbl_RevTran_Detail.curAmount,
    tbl_RevTran_Detail.curPaymentAmt, tbl_RevTran_Detail.curCheckAmt,
    tbl_RevTran_Detail.curCashAmt, tbl_RevTran_Detail.lngSeqNo,
    tbl_RevTran_Detail.strDLTypeLic, tbl_RevTran_Detail.strDLMRSeq,
    tbl_RevTran_Detail.curFee, tbl_RevTran_Detail.curLocal,
    tbl_RevTran_Detail.curSurcharge, tbl_RevTran_Detail.lngSerChgCount,
    tbl_RevGLDesc.strRevCode AS RevCode, tbl_RevGLDesc.strDescription AS RevDesc,
    tbl_RevGLDesc.strSumCode AS SumCode, tbl_RevGLDesc.strSumCode2 AS SumCode2,
    tbl_RevGLDesc.strSumCode3 AS SumCode3, IIf([strtranCode2]="D",[curAmount],0) AS RevDL,
    tbl_RevGLDesc.curFee AS RGLcurFee, tbl_RevGLDesc.curLocal AS RGLcurLocal,
    tbl_RevGLDesc.curSurcharge AS RGLcurSurcharge, tbl_RevTran_Detail.strDistCode,
    tbl_RevTran_Detail.curDistAmt, tbl_GLAcct.strGLAcctNo AS GLAcctNo1,
    tbl_GLAcct.strDescription AS GLDesc1, tbl_GLAcct_1.strGLAcctNo AS GLAcctNo2,
    tbl_GLAcct_1.strDescription AS GLDesc2, tbl_GLAcct.lngGLAcctNoID AS GLAcctID1,
    tbl_GLAcct_1.lngGLAcctNoID AS GLAcctID2
    FROM tbl_RevTran_Master INNER JOIN (((tbl_RevGLDesc LEFT JOIN tbl_GLAcct
    ON tbl_RevGLDesc.lngFundAcctID1
    = tbl_GLAcct.lngGLAcctNoID) LEFT JOIN tbl_GLAcct AS tbl_GLAcct_1
    ON tbl_RevGLDesc.lngFundAcctID2
    = tbl_GLAcct_1.lngGLAcctNoID)
    INNER JOIN tbl_RevTran_Detail ON tbl_RevGLDesc.lngRevGLDescID
    = tbl_RevTran_Detail.lngRevGLDescID)
    ON tbl_RevTran_Master.lngRevTranID
    = tbl_RevTran_Detail.lngRevTranID
    WHERE ((((tbl_RevTran_Master.dtmRevDate)
    >=[Enter Start Date: Example m/d/y, or OK for All]
    Or (tbl_RevTran_Master.dtmRevDate)
    Like [Enter Start Date: Example m/d/y, or OK for All] & "*")
    And ((tbl_RevTran_Master.dtmRevDate)
    <=[Enter End Date: Example m/d/y, or OK for All]
    Or (tbl_RevTran_Master.dtmRevDate)
    Like [Enter End Date: Example m/d/y, or OK for All] & "*"))
    AND ((tbl_RevGLDesc.strRevCode) Between "501" And "525"
    Or (tbl_RevGLDesc.strRevCode) Between "551" And "575"));
    </pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Problem With Enter Parameter Value? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Create a form with text boxes txtStartDate and txtEndDate.
    Set their Format property to Short Date or another date format.
    Replace the parameters in the query with references to the text boxes in the format
    <code>
    [Forms]![NameOfTheForm]![txtStartDate]
    </code>
    Open the report from this form.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem With Enter Parameter Value? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    After further review I found:

    =[Enter Start Date: Example m/d/y, or OK for All]

    and

    =[Enter End Date: Example m/d/y, or OK for All]

    in report footer that was recently added

    Thanks for your recommendation

    John

Posting Permissions

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