Wrox Programmer Forums
BOOK: Beginning Access VBA
This is the forum to discuss the Wrox book Beginning Access 2002 VBA by Robert Smith, Dave Sussman, Ian Blackburn, John Colby, Mark Horner, Martin Reid, Paul Turley, Helmut Watson; ISBN: 9780764544026
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning 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 August 5th, 2008, 11:18 AM
Registered User
Join Date: Aug 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default MakeQueryDef - error message

I've been trying to use the example on p. 253 of Beginning Access 2000 VBA on a db I'm working on and it gives me a user-type not defined error message. Has anyone had the same problem? and how did you solve it? Thank you much!

This is the code:

Function MakeQueryDef(strSQL as String) As Boolean

Dim qdf as QueryDef

If strSQL = " " Then Exit Function

Set qdf = CurrentDB.CreateQueryDef("qryExample")
qdf.SQL = strSQL

MakeQueryDef = True

End Function
Old February 21st, 2009, 05:38 PM
Authorized User
Join Date: Jul 2008
Posts: 38
Thanks: 1
Thanked 2 Times in 2 Posts

This is an old post but I'll answer in hopes of helping someone out in the future if they come across this.

The likely problem was that Access 2000 doesn't have a DAO reference assigned by default and since this is DAO code that was posted, it would be necessary to make sure to add a reference to Microsoft DAO 3.x (where x is a number like 51 or 6).

Bob Larson
Access MVP (2008-2010, 2011)
Free Access tutorials, samples, tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
ERROR MESSAGE underbuchha Visual C++ 2005 0 September 30th, 2006 02:50 AM
Where does the error message go? Wei Wang BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 March 13th, 2006 02:03 PM
Error Message alannoble26 Excel VBA 4 November 25th, 2005 11:20 AM
Help with Error message mariakovacs Classic ASP Databases 3 October 10th, 2003 03:59 PM

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