Solved

acViewPreview problem

Posted on 2011-03-10
5
612 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 119

Expert Comment

by:Rey Obrero
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now