Ms Access Error 3125
Ask a Question Need help? Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. Getting error " '' is not a valid name... [Error 3125] Expert 100+ P: 931 patjones Hi: I've got a backend database, with several tables linked together via one-to-many relationships, and a front end database that links to those tables. The problem is, when I attempt to look at the relationships from the front end, I get '' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. According to the help window, this is Error 3125. Any ideas? Thank you ... Pat Feb 19 '08 #1 Post Reply ✓ answered by patjones The problem turned out to be an apostrophe in a folder name that is part of the path to the back end file. Kind of dumb of me to use an apostrophe in a folder name I suppose. Be there it is for anyone else having the same issue! Share this Question 5 Replies Expert 100+ P: 931 patjones The problem turned out to be an apostrophe in a folder name that is part of the path to the back end file. Kind of dumb of me to use an apostrophe in a folder name I suppose. Be there it is for anyone else having the same issue! Feb 19 '08 #2 reply Expert 100+ P: 1,384 Scott Price LOL, as I've said before, programming gives all of us plenty of opportunities to do dumb things :-) Doesn't mean that we are dumb people! Thanks for posting back with what the problem was! Regards, Scott Feb 20 '08 #3 reply P: 1 Chicanoy hi zepphead80, Have the same problem. I am using Access 2007 which is link to Access 2003 table. You mention that "The problem turned out to be an apostrophe in a folder name that is part of the path to the back end file".. I know I have to remove the apostrophe BUT HOW?? is it in a code? VBA? or something else? I am just a beginner so please bear with me.. Thanks Oct 8 '09 #4 reply Expert 100+ P: 931 patjones Hi Chicanoy - I just saw your post now and you've probably already solved your problem, but...what I would do is simply change the location of yo
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 Error 3125 when I run SQL SELECT query to fetch a row with a “.” up vote 0 down vote favorite Here is my datasheet, tblTable, https://bytes.com/topic/access/answers/772840-getting-error-not-valid-name-error-3125-a in comma-delimited format: Customer ID, Customer Name 1, Company Inc. My VB code: Public Sub ViewCustomerByJob(varCustomerName As Variant) Dim strSQL As String strSQL = "SELECT * FROM tblCustomer " & _ "WHERE CustomerName = '" & varCustomerName & "'" Dim qd As DAO.QueryDef Set qd = CurrentDb.CreateQueryDef(strSQL) With qd .ReturnsRecords = True .SQL = strSQL End With DoCmd.OpenQuery (strSQL) End Sub Whenever varCustomerName equals "Company Inc.", MS Access throws a 3125 error: SELECT * FROM tblCustomer WHERE http://stackoverflow.com/questions/23326826/error-3125-when-i-run-sql-select-query-to-fetch-a-row-with-a CustomerName = 'Company Inc." is not a valid name. That is the first sentence verbatim. If I go to tblCustomer and delete the "." from "Inc.", then re-run the code, it shows the row: Customer ID, Customer Name 1, Company Inc Without the ".", the SQL query works, but with the ".", it breaks. Why? vba ms-access share|improve this question edited Apr 27 '14 at 19:57 asked Apr 27 '14 at 17:48 Generic_User_ID 1021310 I notice you have a space in the 'Customer Name' column name in your table layout, but not in your SQL... Try adding square brackets around that field name in your SQL, and add the space if there really is one. –Tim Williams Apr 27 '14 at 18:02 Screenshot of the error? –Yawar Apr 27 '14 at 18:57 @TimWilliams Just tried that, but I still get the same error. –Generic_User_ID Apr 27 '14 at 20:02 @Yawar here's a screenshot with TImWilliams' suggestion: i.imgur.com/oSEVlHD.png –Generic_User_ID Apr 27 '14 at 20:05 @Generic_User_ID - the screenshot showed me the problem, thanks--see my answer. –Yawar Apr 27 '14 at 22:15 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote accepted The problem is as Tim Williams has said. Suggestion: give the QueryDef object you're creating a name and pass that name
Custom Search UtterAccess Forums>Microsoft® Access>Access Errors + Error Handling Error 3125 "" is not a valid name when executing query from VBA Forum HomeSearchHelpUA Messages|-- UtterAccess.com NewsAccess http://www.utteraccess.com/forum/index.php?showtopic=1611728 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|-- ms access 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 ms access error 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 Options twentyninehairsView Member Profile Mar 18 2008, 01:45 AM Post#1Posts: 36Joined: 30-January 08From: ID, USAI am implementing security into my application, and I'm attempting to build a query into an error handler module. Query runs fine by itself; but when attempting to execute from my VBA error handling module; I get a 3125 error; ("" is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.) I cannot figure this out. Here's the code:unction LogErrorToTable(strErrDesc As String, lngErrNum As Long, strWhereFrom As String, srtcatagory As String) As BooleanOn Error GoTo Err_LogError Dim strSQL As StringDo