473,513 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Docmd.RunSQL Update is giving back an an error 3464

1 New Member
hi I'm having some trouble running this sql and I get an error #3464 Data type mismatch in criteria expression.

What I'm trying to do is update [tbl_Account]![Available] a Yes/No field to Yes in my after I assign it.
Expand|Select|Wrap|Line Numbers
  1. Dim strSQLb As Variant
  2. strSQLb = DLookup("[ACCOUNT]", "qry_Avail_ACCOUNTS")
  3. DoCmd.RunSQL "Update tbl_ACCOUNTS SET tbl_ACCOUNTS.Used= Yes  where tbl_ACCOUNTS.ACCOUNT=" & strSQLb
and I've tried this;
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunSQL "Update tbl_FIR_ACCT SET tbl_FIR_ACCT.Used= '" & Yes & "' where tbl_FIR_ACCT.FIR_ACCT=" & strSQLb
to no avail.. any help would be much appreciated.
Apr 9 '15 #1
1 1802
NeoPa
32,558 Recognized Expert Moderator MVP
If the [Account] field is not numeric then you need the single-quotes around that value. Certainly not around the Yes.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunSQL "UPDATE [tbl_ACCOUNTS] SET [Used]=True WHERE ([ACCOUNT]='" & strSQLb & "')"
Apr 10 '15 #2

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

Similar topics

2
10802
by: Chicken Kebab Abdullah | last post by:
Does anyone know why I get the error 3464 Data type mismatch from the following code. I have a form with a combo(to choose a consumable) and 2 list boxes on it. list on left is all printers and list on right shows the ones currently compatible with the consumable chosen in the combo at the top.
4
10173
by: Rotsj | last post by:
Hi, i try to execute an update query from within a form, but i get the message: run time error '3144'. Syntax error on the update statement when i try something like this: DoCmd.RunSQL "UPDATE tblKlant " & _ "SET tblKlant.Bedrag = tblKlant.Bedrag + 10.96" & _ " WHERE tblKlant. = forms!!"
7
4269
by: Richard Hollenbeck | last post by:
Help! I don't know why this isn't working: Private Sub Combo9_Change() Dim UsersCourseSelection As String UsersCourseSelection = Me("Combo9").Value Combo13.Visible = True 'the following SQL thing is all on one line in the actual code.
8
11205
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to update 3 row(s)." Is there a way to prevent the message from popping up?
2
5694
by: ben | last post by:
I have the following code in a VBA module: DoCmd.RunSql "Update tData Set sd = Log(Strike/Price) where symbol = '" & symbol & "'" This statement worked fine, and was using the built in math Log function. In a separate module, I added the following function:
1
4077
by: TriednTested | last post by:
Hello I have a subform and to edit the data I place it on the main form where changes can be made, then a cmd button is used to execute the docmd.runsql update query. However I am constantly getting an error msg (syntax error in UPDATE statement). Here is my code: updateSQL = "UPDATE Assistance SET " & _ "Date =" & editDatetxt & ", " & _...
4
28822
by: jamesnkk | last post by:
Hi, I try to run the below statement, it alway popup a box and prompt me to input the unit, what wrong with my statement. There is no sub form. DoCmd.RunSQL "Update tblvndprod set unit= " & Me.UnitMeasurement & " where productID=" & Me.ProductID
2
1499
by: Cole S | last post by:
I am working on a document tracking database (access) and I want the user to select a document number from a combo box, which then updates all the textboxes. Then the user can update the fields then click an update button. This almost works but when I run the below SQL and supplemental code. I get the below error (I had to put some generic names...
17
7092
by: jazee007 | last post by:
Hi everybody, I'm having a headache to update two tables when I click on a button. The idea is as follows: I want the table Sales.Action to be updated to "On-Order" as in the code below DoCmd.RunSQL "UPDATE Sales SET Sales.Action = 'On-Order'" & _ "WHERE (Sales.Action)= 'Re-Order' and (Sales.Barcode_Of_Goods)='" & Me.Barcode_Goods & "'" ...
9
2437
by: AMickey | last post by:
I'm getting a run time error with this vba code and can't figure out how to get it to work. It runs from a button on a form and should update a table. Any help would be appreciated. The code is below: DoCmd.RunSQL "UPDATE Opportunities SET Opportunities. = " & Me..Value + 1 _ & "WHERE SSN=" & & " " _ & "AND...
0
7270
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7565
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7543
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5704
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5103
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4759
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
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 we have to send another system

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.