Results 1 to 10 of 10
  1. #1
    SJB67 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    4

    Question When I edit a record in a form it duplicates instead of updateing. How can I stop thi

    Hi,



    I have a simple table of customer contact details with a form to view/edit them.

    When I edit a record (e.g. I change the company name) it creates a duplicate record with the amendment.

    My primary key is a customer number which I am not changing.

    I have searched but can not find any reference to anyone else having this problem.

    Can anyone suggest areas where I could try to rectify?

    Thanks

    SJB

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Use a bound form as a graphical interface. With the form open in Single Form View or Datasheet View, navigate to an existing record to edit said row. To append a record, navigate past the last row or use the intrinsic New Record button.

  3. #3
    SJB67 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    4
    Many thanks - but that is what I have done.

    As I say it then records any edited record as a new record.

    Creating a new record is not a problem.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Suggest creating new DB file. Import one of the tables that your form is based on. In the new DB, create a new form. In your new DB try to edit data. If successful, add more tables and or queries until you have a new DB with the components necessary to replicate your original form that is causing issues.

  5. #5
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    I believe you have forgotten to include the primary key as a field on your form. Add a textbox and bind the key of your table to that textbox. Then make the textbox hidden so your users won't see it.

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Not having the Primary Key on the Form wouldn't cause this kind of thing. My guess, which I believe is shared by ItsMe, going by his suggestion of importing objects, one-by-one, into a new file, is that corruption has reared its ugly head, most likely in the Form in question.

    Linq ;0)>

  7. #7
    SJB67 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    4
    Many thanks both. I have identified the cause but have as yet no solution!

    Everything works until I make the ID box a combo - so I can drop down and choose which client. I can now see the logic in this as my other fields are then working on the ME.txtbox.Value=Me.Combobox.column(3) etc, and obviously I am then changing a column so it has to save as a new record.

    Does anyone know the best way to be able to search and select a record from a field within the form which won't cause this problem?

    Eventually I was planning on using 'strings' from what I have read....

    Thanks for all the help.

    SJB

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Sorry, but why didn't you tell us this in the beginning? I think you've made a common mistake. Your Combobox is Bound to the ID field, and in order to use a Combobox to retrieve Records it has to be Unbound! You need to go back to a separate Textbox to hold the ID field for each Record.

    Right-click the Combobox, click on Properties then on the Data Tab see if there's something in the Control Source. If there is, delete it, add a Textbox and Bind it to the ID field.

    Linq ;0)>
    Last edited by Missinglinq; 06-11-2014 at 07:14 PM.

  9. #9
    SJB67 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    4
    many thanks I got it working

  10. #10
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Linq ;0)>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-19-2014, 11:02 AM
  2. Replies: 2
    Last Post: 01-04-2013, 09:04 PM
  3. Stop Macro on Last Record in Form
    By wdkoseck in forum Access
    Replies: 1
    Last Post: 12-04-2012, 02:25 PM
  4. Find A Record on a Certain form to edit
    By donnan33 in forum Access
    Replies: 1
    Last Post: 02-29-2012, 02:08 PM
  5. Replies: 2
    Last Post: 11-29-2009, 12:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums