Wrox Programmer Forums
|
BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3
This is the forum to discuss the Wrox book Access 2007 VBA Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Armen Stein; ISBN: 9780470047033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 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 January 17th, 2010, 04:33 PM
Registered User
 
Join Date: Jan 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error in Chapter 11

If no one replies to this, I will simply assume that the code on page 361 is incorrect.

I can't get it to work. Here's what the problem is. Because the form is opened in dialog mode, the rest of the code won't run until you close the form. But once you close the form, the combo box on the form is unavailable. So you get an error in the assignment statement where you define strCompany.

I would be curious what the fix is.
 
Old January 17th, 2010, 04:49 PM
Registered User
 
Join Date: Jan 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default The fix

The way I got around this problem was to create another form --frmInfoHolder -- with one control -- a textbox. In the Report_Open sub, before opening frmFilterReport, I open frmInfoHolder in hidden windowmode. In the afterupdate event of the combo box on frmFilterReport, I set the textbox on frmInfoHolder equal to the combo box.

That way, there is an open form that retains the value of the combo box when the frmFilterInfo is closed, as it must be to allow the Report_Open sub to continue.

The only other change needed is that the DoCmd.Close needs to close frmInfoHolder, not frmFilterReport.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error from Chapter 11 Code winkle BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 1 April 22nd, 2009 02:41 PM
Chapter 11: Error while updating user data pherank BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 March 16th, 2008 07:03 PM
Error in Chapter 11 Sample Code josevi BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 1 February 1st, 2008 01:43 PM
chapter 11 figure 11-7 relative positioning pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 November 29th, 2007 06:11 AM
Chapter 11 kappa3 Wrox Book Feedback 0 October 8th, 2003 11:21 AM





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