Wrox Programmer Forums
|
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference 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 November 1st, 2005, 12:04 PM
Registered User
 
Join Date: Nov 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6

I typed in the sample code starting on pp 135 to help me understand the DAO. When I try to run it, the code errors on the statement set dba= CurrentDb. Message is: Run time error #13-Type mismatch. Which suggests to me that I'm trying to set the variable "dba" to something other then a database as the variable is dimensioned for. Any idea what I'm doing wrong to cause this error? How can I correct it.

 
Old November 2nd, 2005, 08:55 AM
Authorized User
 
Join Date: Jul 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't have a copy of the book with me as I'm interstate at present, so I can't check what's written on the pages you mention.

The syntax set dba = CurrentDb is correct (although I don't recall actually using the letters "dba").

Check to make sure you have DAO referenced. Open any code module, and select References from the Tools menu. If Microsoft DAO 3.6 Object Library is not selected, find it and select it. If it's marked as missing, unselect it, find it and select it again.

If that's not the problem, please post the entire procedure as you have it in your program, and I'll take a look.

Graham R Seach
Microsoft Access MVP
 
Old November 2nd, 2005, 11:48 AM
Registered User
 
Join Date: Nov 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That solved the problem. In the References library the DAO 2.5 instead of 3.6 was selected. When I unselected the 2.5 library and selected the 3.6 the problem went away.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
chapter 7 - chapter 11 pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 January 6th, 2008 11:40 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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