SQL Help - Update Statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • prakashwadhwani@gmail.com

    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.Execu te "UPDATE JVTable SET JVTable.INV_DAT E = " &
    DMY(Me.Txt_Date ) & ", " _
    "JVTable.RcdFm_ PdTo = '"
    & nz(me.txt_RcdFm _PdTo) & "'" _
    "JVTable.Ch q_No = '" &
    nz(me.txt_Chq_N o) & "'" _
    "JVTable.Chq_Da te = '" &
    DMY(Me.Txt_Date ) & ", " _
    "JVTable.Ba nk = '" &
    nz(me.txt_Bank) & "'" _
    "JVTable.Settle d_Bill_No
    = '" & nz(me.txt_Settl ed_Bill_No) & "'"

    Best Rgds,
    Prakash
  • Allen Browne

    #2
    Re: SQL Help - Update Statement

    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.

    <prakashwadhwan i@gmail.comwrot e 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.

    Comment

    • prakashwadhwani@gmail.com

      #3
      Re: SQL Help - Update Statement

      On Feb 26, 4:47 pm, "Allen Browne" <AllenBro...@Se eSig.Invalidwro te:
      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.comwrot e 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_DAT E = #2/25/2008#, JVTable.RcdFm_P dTo
      = "Mr. Henry Dias", JVTable.Chq_No = "AS123456", JVTable.Chq_Dat e =
      #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.

      Comment

      Working...