473,396 Members | 2,090 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.

SQL Help - Update Statement

I'm having a little problem with this Update statement and have been
toiling away to no good.

Could anyone please correct my syntax. Here's the code:

CurrentDb.Execute "UPDATE JVTable SET JVTable.INV_DATE = " &
DMY(Me.Txt_Date) & ", " _
"JVTable.RcdFm_PdTo = '"
& nz(me.txt_RcdFm_PdTo) & "'" _
"JVTable.Chq_No = '" &
nz(me.txt_Chq_No) & "'" _
"JVTable.Chq_Date = '" &
DMY(Me.Txt_Date) & ", " _
"JVTable.Bank = '" &
nz(me.txt_Bank) & "'" _
"JVTable.Settled_Bill_No
= '" & nz(me.txt_Settled_Bill_No) & "'"

Best Rgds,
Prakash
Feb 26 '08 #1
2 1408
Post the SQL statement, i.e. results you get from:
Debug.Print strSql

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<pr*************@gmail.comwrote in message
>
If I leave txt_Chq_Date empty on the form i get the message "Invalid
Use of Null"

After I fill all the fields and try to run the sql i get: "Too few
Parameters. Expected 1."

Can anyone please point out where I'm going wrong ?

Best Rgds,
Prakash.
Feb 26 '08 #2
On Feb 26, 4:47 pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Post the SQL statement, i.e. results you get from:
Debug.Print strSql

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<prakashwadhw...@gmail.comwrote in message
If I leave txt_Chq_Date empty on the form i get the message "Invalid
Use of Null"
After I fill all the fields and try to run the sql i get: "Too few
Parameters. Expected 1."
Can anyone please point out where I'm going wrong ?
Best Rgds,
Prakash.

Thank you so very much for all the hand-holding & support. Here's the
result of my SQL from the Debug.Print StrSql window :

UPDATE JVTable SET JVTable.INV_DATE = #2/25/2008#, JVTable.RcdFm_PdTo
= "Mr. Henry Dias", JVTable.Chq_No = "AS123456", JVTable.Chq_Date =
#2/26/2008#, JVTable.Bank = "HSBC", JVTable.Settled_Bill_No = "123,
456, 789"

Nothing seems obvious to me. I hope you can find the offending code.

Best Rgds,
Prakash.
Feb 26 '08 #3

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

Similar topics

3
by: Robert Mark Bram | last post by:
Hi All! I have the following two methods in an asp/jscript page - my problem is that without the update statement there is no error, but with the update statement I get the following error: ...
8
by: pb648174 | last post by:
I have a single update statement that updates the same column multiple times in the same update statement. Basically i have a column that looks like .1.2.3.4. which are id references that need to...
2
by: serge | last post by:
/* This is a long post. You can paste the whole message in the SQL Query Analyzer. I have a scenario where there are records with values pointing to wrong records and I need to fix them using an...
6
by: HeadScratcher | last post by:
I am trying to speed up my update statements by removing inner select statements. Example: update orders set shipname = (select contactName from customers where customerid = orders.customerID)...
5
by: Wing | last post by:
Hi all, I am writing a function that can change the value "Quantity" in the selected row of MS SQL table "shoppingCart", my code is showing below ...
1
by: amitbadgi | last post by:
HI i am getting the foll error while conv an asp application to asp.net Exception Details: System.Runtime.InteropServices.COMException: Syntax error in UPDATE statement. Source Error: Line...
6
by: FayeC | last post by:
I really need help figuring this out. i have a db with mostly text fields but 2. The user_id field is an autonumber (key) and the user_newsletter is a number (1 and 0) field meaning 1 yes the ...
19
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without...
2
by: travhale | last post by:
in a new project using .net 2005, c#. getting err message "Update requires a valid UpdateCommand when passed DataRow collection with modified rows." source RDBMS is oracle 8i. I add a new...
5
by: Slavan | last post by:
I have an update statement that I'm executing against Oracle database from my C# code and it won't work. UPDATE MenuCaptions SET Caption = N@Caption WHERE MenuId = @MenuId AND CultureId =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.