Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 26th, 2006, 02:13 AM
Registered User
 
Join Date: May 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hiding the report from users

Using Access 2003,I have a module which opens a report in Design Mode. To stop the report displaying to the user, I have the following line:

DoCmd.OpenReport strReportName, acViewDesign, , , acHidden

However, when the following piece of code is run, the report still opens up in Design Mode to the end-user :

    DoCmd.OpenReport strReportName, acViewDesign, , , acHidden

    rs.MoveFirst
    Do Until rs.EOF
        Reports!strReportName.Filter = "Criteria = " & rs!Crit
        DoCmd.OutputTo acOutputReport, strReportName, A_FORMATRTF, _
         strFileLocation & rs!Crit & ".rtf"
        rs.MoveNext
    Loop

    rs.Close
    DoCmd.Close acReport, strReportName

Question: what need's to be changed with the above code to ensure the
report doesn't open up in design mode to the end-user?

Thank you

 
Old June 26th, 2006, 11:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

You're setting the criteria AFTER you open the report. Therefore, Access is giving the report the focus in order to do that, hence your problem.

My recommendation is that you set the criteria BEFORE the report opens (as a field on a form) and then use the OutputTo command or the OpenReport action ALONG WITH the criteria.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding a VBA Code from other users. shamala Excel VBA 5 May 15th, 2011 04:00 AM
multiple users running the same report rashi Access 5 April 25th, 2008 07:48 AM
Hiding Report Columns gupta_abhinav99 Crystal Reports 1 February 9th, 2007 04:38 AM
hiding empty text boxes in an Access report EricTheViking Access 4 September 7th, 2006 11:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.