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 April 21st, 2004, 09:12 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default You Can Never Go Home Again

Hi all,

Whenever I click on the VBA-generated message for my Artists With Multiple Downloads report, I get a nasty run-time error.

This is the error message that comes up whenever I click on OK

Run-time error '2501':
The OpenReport action was cancelled


This is the VBA code I have for the NoData event of the report


Private Sub PreviewReport_Click()
'Open the selected report in Print Preview mode
DoCmd.OpenReport [ReportList Control], acViewPreview
End Sub


I should mention that I am opening that report as well as other reports from the Reports Dialog Box that I designed.

Any ideas?

Thanks in advance,



Ben Horne
Madison Area Technical College student

-------------------------
http://community.webshots.com/user/valerian114

"There are two kinds of people in the world: Those who claim to be Flash junkies and those who actually are Flash junkies"
__________________
Ben Horne
-------------------------
I don\'t want to sound like I haven\'t made any mistakes. I\'m confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
 
Old April 22nd, 2004, 06:57 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

The syntax is

   DoCmd.OpenReport "ReportList Control", acViewPreview

You have brackets [], not quotes "".

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old April 22nd, 2004, 08:19 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Greg,

Thanks for pointing this out. I should mention that I was going by my Access textbook when I was coding the Reports Dialog Box. I guess it's kinda hard to break old habits, right?:D

Thanks again,





Similar Threads
Thread Thread Starter Forum Replies Last Post
Installation on XP Home LilKarty BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 January 3rd, 2007 03:20 AM
What to use for a home made notepad Apocolypse2005 Beginning VB 6 9 June 30th, 2006 11:01 AM
Reload Home Page qazi_nomi HTML Code Clinic 1 August 8th, 2004 12:22 PM
Renaming the home page derek Dreamweaver (all versions) 2 May 24th, 2004 12:33 PM
You Can Never Go Home Again... SerranoG Forum and Wrox.com Feedback 1 October 17th, 2003 10:33 AM





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