Ms Access Runtime Error 3135
FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Queries and JET SQL Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Queries and JET SQL Forum Run-time error 3135 thread701-1713153 Forum Search FAQs Links MVPs Run-time error 3135 Run-time error 3135 vba317 (Programmer) (OP) 19 Jun 13 12:29 OK, I am now getting an error 3135 syntax error in Join operation. I have added the new line command per Andy's request. Any help is appreciated. Tom CODEstrSQL = "INSERT INTO PROC_FYInfo(compid,compmne,compdesc,clntid,uci,clntname,rptpd,rptpddiff,fy,fydiff" & vbNewLine & _ ",fyord,MnthAsDt,mon,monfull,yr,MonShNm,MonFullNm,days,last3mondys,lastdayasdt,impfl) " & vbNewLine & _ "SELECT cl.compid,cmp.compmne,cmp.compdesc,fy.clntid,fy.uci,cl.clntname,fy.rptpd,fy.rptpddiff" & vbNewLine & _ ",fy.fy,fy.fydiff,fy.fyord,fy.monasdt,fy.mon_shnm,fy.mon_nm,fy.pfy" & vbNewLine & _ ",((fy.mon_shnm) & ' ' & (fy.fy)), ((fy.mon_nm) & ' ' & (fy.pfy)),fy.days,fy.last3mondys,fy.lastdayasdt,fy.imp " & vbNewLine & _ "FROM ((dbo_rpt_FYInfo fy " & vbNewLine & _ "INNER JOIN (dbo_rpt_Clients AS cl " & vbNewLine & _ "INNER JOIN dbo_dic_Company AS cmp ON cl.compid = cmp.compid) ON fy.clntid = cl.clntid) " & vbNewLine & _ "INNER JOIN PROC_ReportQueue AS rq ON fy.clntid = rq.clntid " & vbNewLine & _ "WHERE (((fy.clntid) = " & (liClntID) & ")) " & vbNewLine & _ "GROUP BY cl.compid,cmp.compmne,cmp.compdesc,fy.clntid,fy.uci,cl.clntname,fy.rptpd,fy.rptpddiff,fy.fy" & vbNewLine & _ ",fy.fydiff,fy.fyord,fy.monasdt,fy.mon_shnm,fy.mon_nm,((fy.mon_shnm) & ' ' & (fy.fy))" & vbNewLine & _ ",((fy.mon_nm) & ' ' & (fy.pfy)),fy.days,fy.last3mondys,fy.lastdayasdt,fy.imp,fy.fy,fy.pfy " & vbNewLine & _ "ORDER BY cmp.compmne,fy.uci,fy.rptpd;" Debug.Print strSQL The results of the debug.print INSERT INTO PROC_FYInfo(compid,compmne,compdesc,clntid,uci,
your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. SQL Query to VBA Syntax P: n/a p I'm trying to put a query into VBA code and its giving me difficulties. I would like to put the following query: SELECT tbl_Workload.Priority, tbl_Workload.Number AS Num, tbl_Workload.Name, tbl_Workload.Comment AS Comment, tbl_Workload.EmpID, tbl_Workload.TaskID, tbl_Jobs.ID FROM tbl_Workload LEFT JOIN tbl_Jobs ON tbl_Workload.Number = tbl_Jobs.Number WHERE (((tbl_Workload.EmpID)=[Forms].[frm_Main].[Employee])) ORDER BY tbl_Workload.Priority, tbl_Workload.Number; into the http://www.tek-tips.com/viewthread.cfm?qid=1713153 following VBA equivalent. RsSql = "SELECT tbl_Workload.Priority, tbl_Workload.Number As Num, tbl_Workload.Name, tbl_Workload.Commend, tbl_Workload.EmpID, tbl_Workload.TaskID, tbl_Jobs.ID" _ & "FROM tblWorkload LEFT JOIN tbl_Jobs on tbl_Workload.Number = tbl_Jobs.Number" _ & "WHERE (tbl_Workload.EmpID) =" & Me.[Employee] Could someone have a look? Dec 3 '06 #1 Post Reply Share this Question 8 Replies P: n/a Larry Linson "Giving me difficulties" is not very specific. Could https://bytes.com/topic/access/answers/572555-sql-query-vba-syntax you clarify for us what you were expecting and what happens that is different from what you were expecting, and the context in which you encountered the apparent anomaly? Have you used Debug.Print to see if you are, in fact, generating the exact SQL statement that you expected to generate? A couple of SWAGs: If Field EmpID is text, then you need to have some quotation marks generated around the value you obtain from Me.Employee. I'd also include a space before the FROM and before the WHERE... the Query builder performs some formatting, but in the code, what you code is what you get. Larry Linson Microsoft Access MVP "p"
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 18:01:50 GMT by s_nt6 (squid/3.5.20)