Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 4th, 2005, 12:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: South Bend, Indiana, USA.
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query wont work unless I copy and past into new on

I am createing a query in VBA, saving it, then running it, and it does not work.

But if I go into SQL mode, copy and past it into a new query it runs. I have comparied the one that does not work and the one that does and they are identical.

What's up?!!

Here is my code to create it:

Dim dbsNorthwind As Database
    Dim qdfNew As QueryDef
    Dim qdfLoop As QueryDef
    Dim prpLoop As Property

    Set dbsNorthwind = CurrentDb 'OpenDatabase

    ' Create new QueryDef object. Because it has a name, it is automatically appended to the QueryDefs collection.
 Debug.Print strSQL_String
Set qdfNew = dbsNorthwind.CreateQueryDef("YourQueryResults", strSQL_String)
__________________
Mitch
Reply With Quote
  #2 (permalink)  
Old March 4th, 2005, 02:22 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mitch

Where do you have your strSQL_String

Set something like this

strSQL_String = "SELECT * FROM Table"

-vemaju


Reply With Quote
Reply


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
Copy Query rsm42 ASP.NET 1.0 and 1.1 Basics 2 January 24th, 2007 02:11 PM
Adodc connections variable wont work, need help honam00000 VB How-To 1 December 10th, 2006 11:21 AM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
JetComp Wont Work .....HELP!! timmaher Access VBA 3 August 25th, 2005 01:38 AM
code to copy a query recordset to a file Ivan Access VBA 9 October 31st, 2003 06:50 PM



All times are GMT -4. The time now is 04:01 PM.


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