I have a table called "cows" ,showing animal details . age , breed , tag number . i am wanting to set up a form to update these details . Tag number is set as primary key ,( so all tags must be unique)
cant get form to update detail when entering new detail for tag . reports errr "violation unique constraint SYS_PK_47: duplicate values for column 'TAG NUMBER' in statement [UPDATE "cows"SET"age"=?,"cow number"=?WHERE"cow number"=?] If i change the primary key i get several animals with same tag number but differing details .
any help appreciated
form to update table
form to update table
OOo 2.3.X on Ms Windows XP
Re: form to update table
As a cow can have several calves, you cannot use, in the table calf, the cow number as a primary key, which must be unique by definition. I suggest you use the field Calf ID as a key, as I guess this ID is unique. To do so, simply edit the table calf, right click on Cow Number and deselect Primary Key, the right-click on the field Calf ID and select Primary key.
If I may, I also suggest that you do not use a field containing the age of the cow, or else you will have to update this field every year.
If I may, I also suggest that you do not use a field containing the age of the cow, or else you will have to update this field every year.
LibreOffice 4.2.3.3. on Ubuntu 14.04
Re: form to update table
tried above thankyou . still having problems with it not updating the data but coming back with same error . What have i not set right . Or will forms not updat current data , only enter new.
Cow number 1, life id 1 breed 1... want to replace with
Cow number 1, life id 2 breed 1...or
cow number 1, life id 1, breed 2.
the only constant will be cow number .
thankyou
Cow number 1, life id 1 breed 1... want to replace with
Cow number 1, life id 2 breed 1...or
cow number 1, life id 1, breed 2.
the only constant will be cow number .
thankyou
- Attachments
-
- New Database Herd.odb
- (11.6 KiB) Downloaded 206 times