472,331 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,331 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 4843
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...
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...
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...
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...
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...
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...
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...
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: ...
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...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.