Solved

acViewPreview problem

Posted on 2011-03-10
5
673 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 85
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

627 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