Ms Access 3075 Syntax Error Missing Operator
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company 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 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Access: Runtime error 3075 (missing operator) in SQL update query up vote 2 down vote favorite First time using Access and wanted to make an update query that uses a variable for its table name. Now, I've gotten myself into a web of nothing good. When I get to the part the SQL code is needed for, I get Runtime error 3075 - Missing operator in '(((" + enteredid + ".todayDate)=Format(Now()','""Short Date"")))' I've never coded in SQL, so I have no clue what operators are needed. My code: strSQL = "UPDATE " + enteredid + " SET " + enteredid + ".signIn = Format(Now(),""Short Time"") WHERE (((" + enteredid + ".todayDate)=Format(Now()','""Short Date"")));" sql ms-access ms-access-2013 share|improve this question edited Sep 13 '14 at 15:12 HansUp 79.3k114371 asked Sep 13 '14 at 1:14 Gandalf the White 3814 1 You've got some random apostrophes in the last 'Format' function - see what happens without them :) –Tim Sep 13 '14 at 7:56 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted My suggestions: You can avoid the whole Format() issue in the WHERE clause by using the Date() function instead of trying to extract just the date part of Now(). Since you are doing an UPDATE on a single table you can just use the field (column) names without the TableName. prefix. To make your code more robust, enclose the table name in square brackets so it won't crash if the table name contains spaces or other "funny" characters. So, the revised code would look more like this: strSQL = _ "UPDATE [" + enteredid + "] SET " + _ "signIn = Format(Now(),""Short Time"") " + _ "WHERE todayDate = Date()" share|improve this answer answered Sep 13 '14 at 14:23 Gord Thompson 56.4k74795 2 Excellent suggestions. Since Gandalf is new to Access, he should learn how to inspect the UPDATE statement his code builds. Debug.Print strSQL would help. After running the code, Ctrl+g to view the statement text in the Immedi
Operator) in query expression 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 9 of 9 Thread: Run Time Error'3075': Syntax Error(Missing Operator) in query expression Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode http://stackoverflow.com/questions/25818913/access-runtime-error-3075-missing-operator-in-sql-update-query May 11th, 2009,10:50 AM #1 mcleyn View Profile View Forum Posts Thread Starter Junior Member Join Date May 2009 Posts 28 Run Time Error'3075': Syntax Error(Missing Operator) in query expression I am running a database using MS Access 2000 along with Visual Basic. Inside the database I am running a specific tracking summary form that takes information from a populated main table. http://www.vbforums.com/showthread.php?568912-Run-Time-Error-3075-Syntax-Error(Missing-Operator)-in-query-expression Inside the tracking summary form I have three combo boxes; Status, Fiscal Year and Province, with their respective choices. When a user chooses one of the choices within the combo boxes it gives a Run-Time Error'3075': Sytnax error (missing operator) in query expression 'tblmain.Status comment tblMain.ProjectTitle'. More Information About the Error: When I debug the error it highlights the line of code: Me.RecordSource = sql I have declared the variables and there is no other errors with the other code only the highlighted line. There are also other lines of code stated under the highlighted line of code, they are not highlighted but may or may not be part of the problem, I am unsure of this. Me.RecordSource = sql -(highlighted code) Me.cboStatus = statusTemp -(not highlighted) Me.cboFiscalYear = fiscalYearTemp -(not highlighted) Me.cboProvince = provinceTemp -(not highlighted) I am not sure what to do with this error. What do you think the problem is and how do you think I can fix this? Reply With Quote May 11th, 2009,11:00 AM #2 KTech View Profile View Forum Posts Visit Homepage Lively Member Join Date Jun 2008 Location
when serching + Ask a Question Need help? Post your question and get tips & solutions https://bytes.com/topic/access/answers/958510-run-time-error-3075-syntax-error-missing-operator-query-expression-when-serching from a community of 418,595 IT Pros & Developers. It's quick & easy. Run-time error 3075 syntax error (missing operator) in query expression when serching P: 1 http://www.utteraccess.com/forum/index.php?showtopic=1994917 pptechs Hello. In dying need of assistance. All I am trying to do is search a table for a valid user ID for a form login screen and ms access I am getting error : "Run-time error 3075 syntax error (missing operator) in query expression " I get it {on line #8} when using this code. Here is my subroutine and this is MS Access Expand|Select|Wrap|Line Numbers PrivateSubCommand84_Click() IfIsNull(Me.Text85)Then MsgBox"PleaseenterLoginID",vbInformation,"ValidLoginIDRequired" Me.Text85.SetFocus Else 'ProcessthesearchforValiduserID 'RIGHTHEREISWHEREIGETTHESYNTAXERRORATTHISIF'STATEMENTBEFORETHEMESSAGEBOX If(IsNull(DLookup("UserLoginID","tblUserAccountControl","UserLoginID='"&Me.Text85.Value&"'")))Then MsgBox"IncorrectLoginID" Else DoCmd.Close DoCmd.OpenForm"Form_VKEYPWD" EndIf EndIf EndSub Sep 7 '14 #1 ms access 3075 Post Reply Share this Question 2 Replies P: 94 GKJR Try putting the field name in braces like "[User Login ID]", and/or I think you need to remove the quotes that surround Me.Text85.Value since this value is a number and not a string. Sep 7 '14 #2 reply Expert Mod 15k+ P: 29,923 NeoPa Absolutely right to surround the reference to User Login ID with brackets ([]), but I suspect the value probably is actually a string, so no change on the quotes. Sep 7 '14 #3 reply Message Cancel Changes Post your reply Join Now >> Sign in to post your reply or Sign up for a free account. Similar topics Run-time error '3075': Syntax error in string... Hash String Getting an error saying syntax error (missing operator) in query expression Run-time error 3075 Syntax error (missing operator) in query expression Run-time error 3075 - Syntax error in string in query expression VB6/MS-access error C2061: syntax error : identifier run time error 3
Custom Search UtterAccess Forums>Microsoft® Access>Access Forms Runtime Error '3075' Syntax Error (missing Operator) When Using Dlookup(), Access 2003 Forum HomeSearchHelpUA Messages|-- UtterAccess.com NewsAccess Knowledge Center|-- Access Code Archive|-- Access Knowledgebase / FAQ|-- Access TutorialsMicrosoft® Access|-- Local Access User Groups (AUGs)|-- Interface Design|-- Access Q and A|-- Access Tables + Relationships|-- Access Queries|-- Access Forms|-- Access Reports|-- Access Macros|-- Access Modules|-- Access Date + Time|-- Access Errors + Error Handling|-- Access Built-in Functions|-- Access Searching + Data Mining|-- Access Records|-- Access Security|-- Access Automation|-- Access Database Container|-- Tool bars, Menu bars + Ribbon|-- Access Services (Web Databases)|-- Access Data Access Pages (Deprecated)|-- Access Data Projects - ADP|-- Access Runtime, Packaging & DeploymentAnd More...|-- Microsoft SQL Server|-- SQL Server Reporting Services|-- Microsoft SharePoint|-- Microsoft Internet Explorer|-- Visual Basic 6 and Earlier|-- Visual Basic 2003 and Later|-- ASP and VBScript|-- Web Development|-- PHP, Perl, MySQL and Postgres|-- Other Database Engines|-- BI Tools and Applications|-- JAVA and C#|-- GraphicsMicrosoft® Office|-- Microsoft Excel|-- Microsoft Excel FAQs|-- Microsoft Word|-- Microsoft Outlook|-- Microsoft PowerPoint|-- Microsoft FrontPage/Exp. Web|-- Other Microsoft ProductsPC|-- Network Issues|-- Q & A - Hardware|-- Q & A - Software|-- Q & A - Other PC|-- Virus + Security DiscussionUtterAccess Odds and Ends|-- General Chat|-- Q & A - UtterAccess.com Forums|-- Q & A - Access Wiki