Inside the form, it crashes on the testqry.execute line with the run-time error. Share it with others Like this thread? As I cannot perform a SQL lookup in a calculated cell, I am running a VBA script to do the heavy lifting for me, passing the three entered values as arguments. Anyone know what it is? Check This Out
When you give Execute a plain (row returning) SELECT query, you will always get error #3065, "Cannot execute a select query". Granted Parameter queries might be more complicated up front, but in the long run they are more reliable. __________________ -- Michael Lueck Lueck Data Systems To view links or images in FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions? Click Here to join Tek-Tips and talk with other members!
Not the answer you're looking for? Inside the form, it crashes on the testqry.execute line with > the run-time error. > > I have as references: > Visual Basic For Applications > Microsoft Access 9.0 Object Library bmahony993View Member Profile Jun 4 2007, 01:29 PM Post#4Posts: 208Joined: 28-December 04Great - I'll change the syntax to start, and then try a record set to put the records into a
SyntaxSocialist View Public Profile Find More Posts by SyntaxSocialist
Steele, Jul 12, 2003, in forum: Microsoft Access VBA Modules Replies: 3 Views: 1,083 Tim Ferguson Jul 14, 2003 Re: db.execute action query created in QBE Tim Ferguson, Jul 12, 2003, Openrecordset Vba rs.Close Set rs = nothing Set TestDB = Nothing -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) Dirk Goldgar, May 7, 2004 #2 Advertisements Dirk Goldgar Just click the sign up button to choose a username and then you can ask your own questions on the forum. Browse other questions tagged sql ms-access vba or ask your own question.
Thank you again Red Flag This Post Please let us know here why this post is inappropriate. johnve (TechnicalUser) (OP) 12 Oct 14 20:06 Hi All, Thank you for your posts. So what I am saying is it a bit more complicated than what you are asking for, but should be good reference. __________________ -- Michael Lueck Lueck Data Systems To view Why are Squibs not notified by the Ministry of Magic Prepared for Yet Another Simple Rebus?
Find More Posts by mdlueck
You know, when the compiler says "Error: I don't like this insert statement." –Donnie Jun 8 '10 at 18:55 3 EXECUTE is for DML statements, not for SELECT statements. http://knowaretech.com/cannot-execute/access-runtime-error-3065-cannot-execute-a-select-query.html Heuristic algorithms for the dense assignment problem The nth numerator How is True < 2 implemented? You'll be able to ask any tech support questions, or chat with the community and help others. Darrylles (Programmer) 8 Oct 14 17:28 Well spotted max.
Discussion in 'Access VBA Modules' started by John Sanders, May 7, 2004. That is an example of what I was hoping to see from your sending the SQL query. __________________ -- Michael Lueck Lueck Data Systems To view links or images in signatures Or for heaven's sake, just paste it into SQL view in a new blank query and run it! –David-W-Fenton Jun 8 '10 at 20:12 add a comment| 5 Answers 5 active this contact form Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Apr 6th, 2006,12:35 PM #2 ckib Board Regular Join Date Sep 2005 Posts 219 Okay, I just pulled out
You may use the OpenRecordset method. Execute is for 'command' queries that don't return values. But there must be a better way that this!
Close Reply To This Thread Posting in the Tek-Tips forums is a member-only feature. White ring of pus forming around branches n-dimensional circles! however I think you are asking how to programmatically push the button, yes? Sign up now!
I'm already dynamically building the SQL successfully. Member Login Remember Me Forgot your password? LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode navigate here Here is the code: ' if no contacts set for delete, skip the cleanup strSQL = "SELECT * FROM tblContact " & _ "WHERE (((tblContact.cont_projectID)='" & strProjectID & "' Or (tblContact.cont_projectID)
What I want to do now is add code to the btnRunQuery_Click procedure that will run a query based on my dynamically constructed SQL. If you get one, trap the error and move on from there. QueryDef.Parameters Add this: Quote: Originally Posted by SyntaxSocialist Code: 'Build mySQL mySQL = "SELECT " & strSel & "FROM tblMain " & "WHERE " & strWhere Debug.Print mySQL Press Ctrl-G to All rights reserved.Unauthorized reproduction or linking forbidden without expressed written permission.
All of the individual suite applications are supported here, so please post your question in the relevant section for help. Find More Posts by mdlueck 05-08-2013, 09:53 AM #9 SyntaxSocialist Newly Registered User Join Date: Apr 2013 Posts: 109 Thanks: 25 Thanked 1 Time in Since every search will be a little bit different and there could be millions (edit: an infinite number) of combinations of search criteria, I'm thinking I want to use a temporary more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed
do stuff with rs ... You currently have 0 posts. Please disregard this unwarranted message. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) Dirk Goldgar, May 7, 2004 #4 John Sanders Guest Dirk Goldgar wrote: > You'll be able to ask questions about MS Office or chat with the community and help others.
Draw some mountain peaks Is this an isomorphism possible? I know I must be close, but can't get the syntax right ... not sure what use it will be to you, since it's just a SELECT statement, FROM statement, and WHERE clause, like I said. Share it with others Twitter Linked In Google Reddit StumbleUpon Posting Permissions You may not post new threads You may not post replies You may not post attachments You may not
RE: Run-time error '3065' Cannot execute a select query. What exactly are you trying to accomplish? Actually, I don't really care how many records are in the set, only if there are NO records in the set. What's the difference between a query definition and query parameters?
Try it this way: insert into accounts_changes select * from Accounts where [Agency Code] in ( select [Agency Code] from tableimport) If that still fails, verify you have the same number mdlueck View Public Profile Visit mdlueck's homepage!