473,322 Members | 1,408 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,322 software developers and data experts.

runsql update error with date

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:
Expand|Select|Wrap|Line Numbers
  1. updateSQL = "UPDATE Assistance SET " & _
  2. "Date =" & editDatetxt & ", "  & _
  3. "Assistance ='" & Me.aAssistancetxt & "', " & _
  4. "Amount =" & Me.aAmounttxt & " " & _
  5. "WHERE assistanceID =" & Me.aAIDtxt
  6.  
  7. DoCmd.RunSQL updateSQL
I have located the cause of the error to the line ["Date=" & editDatetxt & ", " & _ ] I have tried adding ' and # around editDatetxt but I keep getting the error. Assistance.date is formated as date/time (short date) and editDatetxt is also formatted to short date.
Any help greatly appreciated.
TIA
Apr 2 '07 #1
1 4048
MMcCarthy
14,534 Expert Mod 8TB
Try this ...

Expand|Select|Wrap|Line Numbers
  1. updateSQL = "UPDATE Assistance SET " & _
  2. "Date =#" & Me.editDatetxt & "#, "  & _
  3. "Assistance ='" & Me.aAssistancetxt & "', " & _
  4. "Amount =" & Me.aAmounttxt & " " & _
  5. "WHERE assistanceID =" & Me.aAIDtxt
  6.  
  7. DoCmd.RunSQL updateSQL
Also change the name of the Date field to something else and Date is a function in Access and this might be causing a problem.

Mary
Apr 2 '07 #2

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

Similar topics

2
by: Sims | last post by:
Hi, I have a table with 3 columns, something like... NAME, VALUE, DATE, (String(255), int(11), int(11)). And for argument lets say the data is row = "A", 10, 1076968526 row = "A", 10,...
3
by: BlackFireNova | last post by:
This concerns an Access 2002 (XP) database. There are two fields, "Notes" (Memo Field) and "Notes Update" on a form (among others) which I am concerned with here. Problem: I need to be able...
4
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...
8
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...
3
by: spw | last post by:
Hello, I am beginner/intermediate user of Access and primariy use the 'Tables' and Queries' objects. I have a query that is pointing to a set of tables that will be updated every week. This...
2
by: kaka | last post by:
I'm runnig Redhat 7.3 with postgresql 7.3.4 builded from sources and upgraded recently. I receive this error ( never received before upgrade ) and I don' t know what to do. Error while executing...
1
by: Reshmi Jacob | last post by:
Hello, Can any one help me in creating a trigger to update system date into a table while inserting a record into that table. I tried it like this, it is showing error !!! The following...
3
by: UAlbanyMBA | last post by:
I am trying to update a record but I keep receiving an error, "Data type mismatch in criteria expression." Here is the code: DoCmd.RunSQL ("Update Caller2 SET Ext = '" & Me!txtExt & "' where...
22
by: tonialbrown | last post by:
I have an Sql update statement that I am using that updates the data from a record chosen by the user from a list box lstDelFrom. This is working for all the text fields & updates fine. Once I add...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.