A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Data entry in form containing combo box



 
 
Thread Tools Display Modes
  #1  
Old December 19th, 2006, 08:59 PM posted to microsoft.public.access.forms
iht
external usenet poster
 
Posts: 1
Default 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  
Old December 20th, 2006, 12:55 AM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.