Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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.
Reply With Quote
  #2 (permalink)  
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.
Reply With Quote

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
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

All times are GMT -4. The time now is 05:08 PM.

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