Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136

    Smile Unanswered: Criteria from form displays on report in print preview - but not when printed on pape

    I have a form that I enter criteria into and when I click on OK, the report opens and I see my criteria (From and Thru Dates) on the report in print preview. When I print the report, all I get is #Name? where the dates should be.

    Why would the dates show up in print preivew but not on printed paper?

    Thanks so much for any help you can give.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    When do you close the criteria form?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    I am using: DAO 3.6/2k. FYI - I'm very new at this.

    The OnClick Event for the OK button reads:

    DoCmd.OpenReport "Performed Visits", acViewPreview
    DoCmd.Close acForm, "Report Visits"

    I changed the acPrintPreview to acPrint. This fixed the problem but the user cannot view only.

    I'm still trying to pick up visual basic, but it's been hard for me to understand. Should I have something for the OnPrint command inside my report?

    Thanks so much.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    The problem is you're closing the form before the report actually gets printed. Access gets confused because the variables it's looking for don't exist anymore. Try closing the form in the OnClose event of your report instead of at the end of your onclick event.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    That makes total sense, and of course it worked! Thank you so much for your help!

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Report

    I just wanted to send you a sample of how we have a ReportForm and take values from that onto a report. Attached is the sample mdb. Maybe there is something you can use from it.
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Dec 2003
    Posts
    268

    Nice form But...

    Why didn't you just use calendar controls. It would have totally made the form a lot cleaner, and much much more user friendly.

    Just a thought.

Posting Permissions

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