Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003

    Unanswered: problem in updating

    hi , i m having pro in update query, it says duplication of primary key, and if i remove rs.Fields(0) = txt_Date then it doesn't give any error, but neither works.
    Set rs = CurrentDb.OpenRecordset("select * from sukkur where Comments <> 'Data';")
    rs.Move (Listmem.SelectedItem.Index)

    rs.Fields(0) = txt_Date 'primary key
    rs.Fields(1) = txt_Us
    rs.Fields(2) = txt_Ds
    rs.Fields(3) = txt_Us - txt_Ds
    rs.Fields(4) = "Data"

  2. #2
    Join Date
    Feb 2003
    Auckland, NZ
    If you add a date and it gives you the error:

    duplication of primary key

    then it means there is a record with the same date.

    It won't update if the date is left out because a primary key can't be null.
    JJ Kennedy
    Double J IT Solutions

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts