473,396 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Editing field in filtered SQL query - RunTime Error 3464

In the following code I am attempting to open a query and edit the
lastMaintenance field for a particular equipment number. My code looks like
this:

Dim db As Database
Dim rs As Recordset
Dim SQL As String

Set db = DBEngine.Workspaces(0).Databases(0)
Set rs = db.OpenRecordset("SELECT * From qryPlannedMaintenance WHERE
[EquipmentNumber] = '" & EquipmentNumber & "';")
rs.MoveFirst
rs.Edit
rs![LastMaintenance] = Date
rs.Update
rs.Close

Set rs = Nothing
Set db = Nothing

At the moment I am getting this run time error on the Set rs line:
Run-time error 3464. Data type mismatch in criteria expression.

Any suggestions?

Thanks in advance
Nov 13 '05 #1
1 4897
Solved
It was the ' 's

thanks

"Will" <Wi*****************@hotmail.com> wrote in message
news:39*************@individual.net...
In the following code I am attempting to open a query and edit the
lastMaintenance field for a particular equipment number. My code looks like this:

Dim db As Database
Dim rs As Recordset
Dim SQL As String

Set db = DBEngine.Workspaces(0).Databases(0)
Set rs = db.OpenRecordset("SELECT * From qryPlannedMaintenance WHERE [EquipmentNumber] = '" & EquipmentNumber & "';")
rs.MoveFirst
rs.Edit
rs![LastMaintenance] = Date
rs.Update
rs.Close

Set rs = Nothing
Set db = Nothing

At the moment I am getting this run time error on the Set rs line:
Run-time error 3464. Data type mismatch in criteria expression.

Any suggestions?

Thanks in advance

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MX1 | last post by:
I have a query written in MS Access that has a few calculated fields. Is it possible to refer to that query in a form field. I'd like the form field to show the sum of one of the columns from the...
3
by: John young | last post by:
I have been looking for an answer to a problem and have found this group and hope you can assist . I have been re doing a data base I have made for a car club I am with and have been trying to...
1
by: Saintor | last post by:
This is for A97 in runtime or MDE mode. My intent was to define a temporary query using the recordsetclone property / filter / orderby. The controlsource of my chart would be based on a grouped...
0
by: ME | last post by:
I have an application that displays data in a DataGridView. The data is in a DataView that is sorted and at times filtered. One of the columns I have in the dataview is a boolean field called...
7
by: Katherine | last post by:
I'm trying to filter the records on the mainform (MailingList) of my database using a field contained in a subform (Donations). I was basing my code off Allen Browne's Access Tips page (here:...
1
by: dan.cawthorne | last post by:
Kinda Confused to why i cant get a single text field to add up all the Projects that are filtered Via a Query. I Have a Query Based on a Projects Table. The Query Have a Criteria To Select a...
3
by: dstorms | last post by:
Hi there, I'm developing a database for my company, and for the most part I've been successful, with some complex sub-routines already working fine. But this one has me stumped! Some background...
5
by: DAHMB | last post by:
Hi all, Using Access 2007 I have a report called Sunday School Attendance based on a Query called qryAttendance the query is as follows: SELECT tblSundaySchoolAttendance.StudentID,...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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,...

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.