Results 1 to 3 of 3
  1. #1
    BSAS_itguy is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    2

    Auto Populate Fields based on Combo Box selection

    I have a combo box that auto populates address fields, based on the Vendor ID that is chosen.



    All the field son the form are based on a header table for the shipment, the combo box is controledby the vendor table in order to auto populate the address fields.

    Now the form will not allow you to save a new record. It comes back with this long error message:

    "The changes you requested to the table were not successful because they would create duplicate values in the index, primary key or relationship. Change the data in the field or fields that contain duplicate data, remove the index or redefine the index to permit duplicate entires and try again."

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    ok - well your post title and your error message are 2 different topics.

    concerning your error message; this is one case where the error message is accurate and informative (which can be rare ! ).

    the table that is the ultimate record source for this form has one of your fields set up so there can be no duplicates. something about your combo selection or whatever you are doing as the user in the form is causing a duplicate value to go into that field.

    so you have to stop that from happening - or - go to the table and change the setting to allow duplicates. Only do the latter if you own this application and have the insight to know that this change won't truly screw things up....as having duplicate values in a column that should not can be a very important point.

    Hope this helps.

  3. #3
    BSAS_itguy is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    2
    OK, I guess I started this on my own before I learned how to do it. So here the question so I may start the form over again.

    If my user is preparing a new shipment on the form. With all fields blank I want them to be able to type in the Vendors Account number and automatically return the address fields. If the Vendor is not in the database then they will type it in and it will be in there for future use.

    Then they can procede to fill out the rest of the shipment data to create a new record.

    My 3 tables are Shipment.Header- Primary Key-Voucher#
    Shipment.Lines- Primary Key-Autonumber
    Shipment.Vendors- Primary Key-VendorID

    VendorID is in the Shipment.Header table also.

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

Similar Threads

  1. Replies: 9
    Last Post: 07-20-2015, 10:55 AM
  2. Populate a field based on combobox selection
    By rscott7706 in forum Access
    Replies: 5
    Last Post: 06-02-2011, 03:18 PM
  3. Replies: 3
    Last Post: 12-06-2010, 06:35 PM
  4. Replies: 0
    Last Post: 12-02-2010, 11:59 AM
  5. Replies: 3
    Last Post: 10-05-2009, 07:22 AM

Tags for this Thread

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