Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 December 3rd, 2005, 09:57 PM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compile Error (Beginner)

When I try and run this function in the Immediate Window I get the Compile Error: User Defined type not defined. What did I miss
Thanks


Function MakeQueryDef(strSQL As String) As Boolean

Dim qdf As QueryDef

If strSQL = "" Then Exit Function

Set qdf = CurrentDb.CreateQueryDef("qryExample")
qdf.SQL = strSQL
qdf.Close
RefreshDatabaseWindow

MakeQueryDef = True

End Function



 
Old January 16th, 2006, 07:26 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default



Hi ste4en,

This is because you are missing the Data Access Objects reference in your project.
Go to Project-->References and add Microsoft DAO 3.51 Object Library.

Cheers,
   nalla




nalaka hewage





Similar Threads
Thread Thread Starter Forum Replies Last Post
compile error yogeshyl Excel VBA 0 December 12th, 2007 06:41 AM
Compile error: Syntax error: & Else without HELP Corey VB How-To 2 April 21st, 2006 03:25 PM
Compile Error: Michael Gavel BOOK: Beginning Access VBA 2 January 20th, 2004 11:36 AM
Compile Error aglatfel Access VBA 2 January 13th, 2004 04:01 PM
compile error burdickdave C# 1 October 20th, 2003 01:46 PM





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