473,503 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

please help: run time error 3070 database does not recognize ' ' as valid field name

2 New Member
Please help me.
I'm trying to update a database using code in access and the following error appears : "Run time error 3070 the microsoft access engine does not recognize ' ' as a valid field name or expression.
I'm for sure entering a valid name..
Here is my code.
Thank you!!


Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim rs As Recordset
  3. Dim name As String
  4. Set db = CurrentDb()
  5. Set rs = db.OpenRecordset("info", dbOpenDynaset)
  6. name = InputBox(" ")
  7. rs.FindFirst "company_name = " & name  'here is the problem
  8.  
  9.  
May 30 '20 #1
2 2412
cactusdata
214 Recognized Expert New Member
Try this:

Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim rs As DAO.Recordset
  3. Dim name As String
  4.  
  5. Set db = CurrentDb()
  6. Set rs = db.OpenRecordset("info", dbOpenDynaset)
  7.  
  8. name = InputBox("Enter Company Name")
  9. If name <> "" Then
  10.     rs.FindFirst "company_name = '" & name & "'"
  11. End If
May 31 '20 #2
merilu
2 New Member
Cactusdata this helped me a lot, it worked! Thank you!
May 31 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
408
by: camaro77 majau via DotNetMonster.com | last post by:
Sorry by my english but i'm from spain. I have a problem and after search by the web i have know that is due by framework. The message is : setup error "failed to load ressouces from resource...
0
2879
by: SSP | last post by:
Hi All, Sorry for cross posting, but I am not sure where the problem is. Problem: I am not able to connect to any of my Access databases using "Microsoft Jet 4.0 OLE DB Provider". I had no...
3
2504
by: Matthew Louden | last post by:
I attempt to connect ASP.NET application with SQL Server using ADO.NET. I just open a connection, and it had run-time error in line 34: cn.open(): SQL Server does not exist or access denied....
1
1561
by: Nelson | last post by:
Hi, I'm trying to design a simple database in which I can keep track of the amount of time my 5 technicians spend on various jobs. At the start and end of each particular job (could be 5...
2
4025
by: drew.ferraro | last post by:
Hi, I am trying to build a .DLL file that uses "'Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces'". I am trying to build this .DLL as fully signed. However, when I try to build, I...
0
1767
by: imranabdulaziz | last post by:
Dear All, I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2005 as a back End I generated local mode report but as there was no printing option available . I assign...
11
3042
by: Tempalli | last post by:
I am using M.S.Access as backend database and able to add records from Excel but not able to Edit & Update the specific record from M.s Access with reference to cell value given in excel. Kinldy help...
1
7078
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
7
23054
by: Ares6881 | last post by:
This error has been driving me a little bit nuts, I have 2 reports going off the same query, the query pulls in data from a crosstab query. One of the reports is working just fine, but whenever I...
1
4076
by: Paul Howarth | last post by:
Question from a Novice: I have a Query which is based on a Crosstab Query. One of the fields in the Query is "Client". I can "hardcode" a Criteria for the "Client" field and the Query works...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.