Solved

acViewPreview problem

Posted on 2011-03-10
5
660 Views
Last Modified: 2012-05-11
I have this code:
DoCmd.OpenReport "Glassing Inspection Label", acViewNormal, , "[ID]=" & Me.ID

When it executes my report prints and the code that follows:
    Me.Undo
    DoCmd.Close

executes properly.

But...
If I change the acView to Preview,
DoCmd.OpenReport "Glassing Inspection Label", acViewPreview, , "[ID]=" & Me.ID
the report does not show on the screen and the
    Me.Undo
    DoCmd.Close

do not execute.

Any idea why?

Thanks
Brooks
0
Comment
Question by:gbnorton
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35100407
can you upload the db?
0
 
LVL 84
ID: 35100777
Are you certain the Default printer is properly specified on the computer, and that you've set the Report to use the Default printer?

0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 35111551
What's the need for the me.Undo?
Remove that and see what happens.

Also it is not clear if your two code snippets are in the same sub, ...please clarify...

Can you post all the code as it appears in the module please?

Remember if you are opening the report in Print Preview, you are holding it open so you can view it.
If you closed it immediately after opening it, (Which is what your second snippet is doing) what's the point?
0
 

Author Closing Comment

by:gbnorton
ID: 35112882
The reason for using Print Preview for troubleshooting data problems.  You were correct.  Removing the me.undo allowed the preview to stay up.

Thanks
Brooks
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35135145
;-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question