Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Unanswered: Print Preview shows form, not intended report

    I just inherited some code with a customer reported problem. I'm new with Access with no training in it, so be gentle.

    It appears that the code pops up a form, the user then selects a number of fields on that form and clicks a button. A pass-thru query goes out to a SQL Server database, and once the button is clicked, the form is hidden and the report is displayed in preview mode.

    The problem is that if you go up to the print preview button, the hidden form is displayed in the print preview and not the visible report. The customer is expecting to see the report in the print preview.

    At a high level, here is what the code does...

    [ get selected values from form]
    Set loqd = CurrentDb.QueryDefs("QueueOverflowSummary")
    loqd.connect = <...>
    loqd.SQL = <select using info from form>
    loqd.Close
    Set SSdb = CurrentDb
    Set list = SSdb.OpenRecordset("QueueOverFlowSummary")
    RepName = "AbandonsDaily"
    Me!Reports.Visible = False 'This hides the form
    DoCmd.OpenReport RepName, acViewPreview 'This displays the report

    Since the user is looking at the report in preview mode already, should I just disable the print preview button when he is looking at the report? I think if the report came up in the print preview instead of the form, the user would be happy.

    Thanks in advance for any insight you can provide.

    --
    Jim

  2. #2
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133
    Jim,

    The report the customer sees IS a print preview. All he/she needs to do is click on Print in the File menu or the Print icon and it will print out to the selected printer.
    SteveH

  3. #3
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Print Preview shows form, not intended report

    When the report is in "preview" mode, clicking the "Preview" button closes the report and takes you back to the form. To prevent this from happening, you'll have to disable the print preview button.


    Originally posted by codeworrier
    I just inherited some code with a customer reported problem. I'm new with Access with no training in it, so be gentle.

    It appears that the code pops up a form, the user then selects a number of fields on that form and clicks a button. A pass-thru query goes out to a SQL Server database, and once the button is clicked, the form is hidden and the report is displayed in preview mode.

    The problem is that if you go up to the print preview button, the hidden form is displayed in the print preview and not the visible report. The customer is expecting to see the report in the print preview.

    At a high level, here is what the code does...

    [ get selected values from form]
    Set loqd = CurrentDb.QueryDefs("QueueOverflowSummary")
    loqd.connect = <...>
    loqd.SQL = <select using info from form>
    loqd.Close
    Set SSdb = CurrentDb
    Set list = SSdb.OpenRecordset("QueueOverFlowSummary")
    RepName = "AbandonsDaily"
    Me!Reports.Visible = False 'This hides the form
    DoCmd.OpenReport RepName, acViewPreview 'This displays the report

    Since the user is looking at the report in preview mode already, should I just disable the print preview button when he is looking at the report? I think if the report came up in the print preview instead of the form, the user would be happy.

    Thanks in advance for any insight you can provide.

    --
    Jim

  4. #4
    Join Date
    Apr 2004
    Posts
    2
    Thanks for the replies. I was thinking the same thing, but being new to all this, I thought double-checking was the thing to do.

    I appreciate the quick replies.

    --
    Jim

Posting Permissions

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