3075 Syntax Error Date
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 29 Sep 2016 21:02:55 GMT by s_hv1002 (squid/3.5.20)
Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 04-13-2013, 01:10 PM #1 Chalkie42 Newly Registered User Join Date: Feb 2008 Location: Scotland Posts: 41 Thanks: 5 Thanked 0 Times in 0 Posts Date format causing Run Time 3075 error Hi Folks, I spent the last seven hours trying to get this to work - me and http://answers.microsoft.com/en-us/msoffice/forum/msoffice_access-mso_other/run-time-error-3075-syntax-error-in-date-in-query/578546b9-da70-4458-9b9a-e995ed16cc58 Google are great friends! I'm trying to get my bound form to populate a text box with a value (AppointmentDesc) filtered by the ClientID [ComboBox] and the Appointment Date selected in another ComboBox [SessionDate] My code looks like this: Code: Me.Text48 = DLookup("AppointmentDesc", "qrySample", "(ClientID = '" & Me.Combo42.Value & "') AND (AppointmentDate = #" & Me.SessionDate.Value & "#)") The code is http://www.access-programmers.co.uk/forums/showthread.php?t=245342 in the 'After Update' event of the SessionDate Combo. I get a runtime error 3075 when the code is executed saying I have a syntax error but I just can't find it. Can someone please put me out of my misery? Chalkie42 View Public Profile Find More Posts by Chalkie42 04-13-2013, 01:15 PM #2 bob fitz Newly Registered User Join Date: May 2011 Location: Essex England Posts: 3,078 Thanks: 23 Thanked 594 Times in 582 Posts Re: Date format causing Run Time 3075 error Try: Me.Text48 = DLookup("AppointmentDesc", "qrySample", "ClientID = " & Me.Combo42 & " AND AppointmentDate = #" & Me.SessionDate & "#") __________________ Bob Fitzpatrick Microsoft Community Contributor Award (2011) If this helped, please click the scales at the bottom left of this posting. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Many thanks. I have never failed. I have found a thousand ways that do not work! bob fitz View Public Profile Find More Posts by bob fitz 0
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/29990457/sql-vba-run-time-error-3075-syntax-errormissing-operator-in-query-expression of this site About Us Learn more about Stack Overflow the company http://www.vbforums.com/showthread.php?557748-Run-time-error-3075-Syntax-error-in-string-in-query-expression-VB6-MS-access Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a syntax error minute: Sign up SQL VBA Run-Time Error 3075: Syntax error(missing operator) in query expression up vote 2 down vote favorite I'm trying to follow a set of loop SQL code for my specific need in an Access Database. And I run into this error Run-Time Error 3075: Syntax error(missing operator) in query expression 'SYRLIB_FLCRDD14.CRARNO=SYRLIB_FPCRDHDR.CHARNO From SYRLIB_FLCRDD14 INNER JOIN SYRLIB_FPCUSMAS on SYRLIB_FLCRDD14.CRCUST=SYRLIB_FPCUSMAS.CNUMBR From in query expression SYRLIB_FLCRDD14 INNER JOIN SYRLIB_FPSECFIL on SYRLIB_FLCRDD14.CRCLRK=SYRLIB_FPSECFIL.SECNUM FROM SYRLIB FLCRDD1'. (for the bolded part, I think it should be SYRLIB_FLCRDD14, I've searched through the entire code, all 23 matches are spelled as "FLCRDD14", I don't see a "FLCRDD1". Am I missing something?) Thank you for all the comment below so far! I've re-edited and re-pasted the entire set of the code based on the below suggestions. I've also taken out the bracket around SELECT and taken out the comma after [Issue by]. I used the immediate window and ran the new query. It gives a different error: Syntax error(missing operator) in query expression 'SYRLIB_FLCRDD14.CRCMMT'. Sub RunDistrackData() 'Pulls Customer Rebate Data 'On Error GoTo Err_Handler: 'DoCmd.SetWarnings False 'DoCmd.Hourglass True Dim rst2 As ADODB.Recordset Set rst2 = New ADODB.Recordset rst2.Open "[TblDC]", CurrentProject.Connection Dim sCHAR As String Dim sName As String Dim sNUM As String Dim SQry As String Dim mySQL As String Dim qfd As QueryDef Dim db As Database Set db = CurrentDb Dim bTime As Date Dim eTime As Date 'bTime = Now() rst2.MoveFirst DoCmd.OpenQuery "Clear Data", acViewNormal, acEdit Do While Not rst2.EOF sCHAR =
in string in query expression VB6/MS-access If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 5 of 5 Thread: Run-time error 3075 - Syntax error in string in query expression VB6/MS-access Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Feb 13th, 2009,02:03 PM #1 srinath_vs View Profile View Forum Posts Thread Starter New Member Join Date Feb 2009 Posts 3 Run-time error 3075 - Syntax error in string in query expression VB6/MS-access Hi, I have an access db that I am trying to query from a vb6 program. I've the following code: Dim sSQLQuery As String sSQLQuery = "SELECT * FROM TblData WHERE ID = " & Chr(39) & ID & Chr(39) ID here is equal to 1234567890 MsgBox sSQLQuery the msgbox says: SELECT * FROM TblData WHERE ID = '1234567890 Note that the quotation is missing at the end Set rs = db.OpenRecordset(sSQLQuery, dbOpenDynaset) Here I get the error: Run-time error '3075' Syntax error in string in query expression 'ID='1234567890'. Note that now there's a single quotes before ID (+ where's the rest of the sql string). As a note, ID is not a numeric field in the access database. Its in as a text-field. Now here's the biggie: this code works for me in my development PC and the query returns with the data in the db. This started happening on another laptop that I installed this application on all of a sudden and I am unable to reproduce this on my PC. Any help is appreciated. Reply With Quote Feb 13th, 2009,03:27 PM #2 wes4dbt View Profile View Forum Posts PowerPoster Join Date Sep 2005 Location Modesto, Ca. Posts 2,902 Re: Run-time error 3075 - Syntax error in string in query expression VB6/MS-access Try this, Code: "SELECT * FROM TblData WHERE ID = '" & ID & "'" Use the ' instead, on both sides of ID Reply With Quote