By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,316 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,316 IT Pros & Developers. It's quick & easy.

SQL Help - Update Statement

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.