Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2012, 02:30 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Red face Shutter Bar opens when I print report

I am using Access 2010, with a database that was created in an earlier version, and converted to 2007.

The code I used to print the report in Access 2007 does not react the same way. Instead of just printing 2 copies of the report as I want it to do, it prints the two copies, and then opens the left Shutter Bar menu. I have set it up so that users do not see any of the menu options. "Display navigation pane" is not checked in the Access Options menu. Here is the code that runs on the command button:


Private Sub printorder_Click()
DoCmd.SelectObject acReport, "NFSsmokingORD", True
DoCmd.PrintOut , , , , 2
End Sub


I did find a function on acCmdWindowHide, but all it does is hide the form I am using to print the report.

I know enough about Access just to make me dangerous- am very much a beginner with code. Any ideas? Thanks!
Reply With Quote
  #2 (permalink)  
Old July 12th, 2012, 02:52 PM
Authorized User
Points: 346, Level: 6
Points: 346, Level: 6 Points: 346, Level: 6 Points: 346, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 13 Times in 13 Posts
Default

Hi,

Try using:

Docmd.OpenReport "NSFsmokingORD", acViewNormal,,,acHidden

instead of SelectObject.

Remember to close the object after printing using Docmd.Close.

I haven't tried this, but can't see why it won't work.

HTH.

Malc.
Reply With Quote
  #3 (permalink)  
Old July 12th, 2012, 04:53 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Red face Getting Closer

Thank you Malcolm,
With your help, I'm getting closer. I used the code below, and it worked (did not open Shutter Bar), but it didn't print the specific record (the record open on the form). It wanted to print ALL records. Can you tell me what I'm missing?

I have a main form (Customer Form) and a subform NFS Orders which are linked by Customer Number. Each record has a unique Order Number. The report's command button to print is on the subform.


Private Sub printorder_Click()
DoCmd.OpenReport "NFSsmokingORD", acViewNormal, , , acHidden
DoCmd.PrintOut , , , , 2
DoCmd.Close
End Sub

Again, thanks. I really appreciate that you took the time to reply to my post.
Reply With Quote
  #4 (permalink)  
Old July 12th, 2012, 05:40 PM
Authorized User
Points: 346, Level: 6
Points: 346, Level: 6 Points: 346, Level: 6 Points: 346, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 13 Times in 13 Posts
Default

Hi,

Amend the OpenReport command to use a WhereCondition:
DoCmd.OpenReport "NFSsmokingORD", acViewNormal, , "[OrderNumber] = " & Me.txtOrderNumber, acHidden

I'm assuming the underlying query of the report has a column named OrderNumber and that the subform NFS Orders has a textbox control named txtOrderNumber. Please amend accordingly if different.

Alternatively, if the report is always used to print single orders you could place a reference to the subform control in the criteria section of the OrderNumber column. You can even set the recordsource of the report in the Open Event to retrieve the specific record too. Many different ways to achieve the end result!

HTH.

Malc.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report print set-up lryckman Access 4 February 25th, 2008 09:04 AM
how to print sub report NagarajuK Crystal Reports 0 December 3rd, 2007 10:05 AM
Crystal report Viewer Not Showing Control Bar simjith Crystal Reports 0 May 20th, 2007 05:28 AM
VS 2002 Crystal Report opens Seagate crystal 8 tusis_1 Crystal Reports 0 May 12th, 2007 11:45 AM
print report lazio Crystal Reports 0 November 1st, 2004 08:38 AM



All times are GMT -4. The time now is 06:28 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.