If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Data entry in form containing combo box
I have a form w/ subforms all containing data from different database tables.
All the tables have same set of primary keys (ID) defined in one-to-one relationship to the primary database. I could edit existing records without problems when my ID numbers are in text boxes. But when I change the ID number to combo box (for faster data-lookup) Access will not allow me to edit old records. The error message reads: The changes you request to the table were not successful because they would create duplicate values in the index, primary key, or relationeship.... Does this mean I have to have 2 forms, one for looking up the ID's and the other for data entry/editing? Thanks in advance for your help. |
#2
|
|||
|
|||
Data entry in form containing combo box
On Tue, 19 Dec 2006 12:59:00 -0800, iht
wrote: I have a form w/ subforms all containing data from different database tables. All the tables have same set of primary keys (ID) defined in one-to-one relationship to the primary database. That is VERY VERY unusual and really smells like bad design. One to one relationships are useful for Subclassing and for field-level security, and not all that much else! Why so many? I could edit existing records without problems when my ID numbers are in text boxes. But when I change the ID number to combo box (for faster data-lookup) Access will not allow me to edit old records. The error message reads: The changes you request to the table were not successful because they would create duplicate values in the index, primary key, or relationeship.... Sounds like you've got the Control Source of the combo set incorrectly, and you're trying to store an existing ID in a new or different record. What is the control source of the combo? What's its RowSource? What if any code do you have attached? Note that a Combo being used to just look up and navigate to a record MUST be unbound - i.e. have nothing in its Control Source property. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|