Solved

acViewPreview problem

Posted on 2011-03-10
5
663 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 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