Combo Boxes and Autopopulate...

torias

New member
Local time
Today, 03:59
Joined
Apr 30, 2008
Messages
3
I have a table which has a composite primary key of two fields. I've created a combo box which displays field 1 and field 2.

I've also created a text box which auto populates with field 2 info (by looking up the relevant column information in the combo box). However, I can't manage to save field 2 data in the relevant table and I keep on getting an error telling me that a primary key cannot contain a null value.

Help please!
 
HI,

Not sure but I think your problem may be the 2 field primary key.
When you are saving the value to field 2 are you also saving the correct value to field 1?

I never use 2 field primary keys because I find them too confusing and liable to unexpected problems.

I would add a field which I usually call tablenameID as an autonumber and make that my primary key.

Maybe that would simplify things for you.

Sue
 
Create a surrogate primary key and make the current primary key into a unique index/constraint. Make your foreign keys a single column and reference the new primary key. Re-link your relationships and re-do your forms/queries, etc.

You will get nothing but trouble from having a 2 field primary key. I'm not a good enough programmer to work with them.
 

Users who are viewing this thread

Back
Top Bottom