FurryGorilla
Technical User
I want to update a table, named CLAIM which has 2 fields, Form_num and RetentionDate, based on a form.
The form_num is a foreign key in another table called CLAIMED which also holds an eartag_num.
I have used two text boxes on the form holding these attributes and a combo box to select the eartag number which will be inserted into the CLAIMED table.
I have then got a button which inserts the appropriate values into the CLAIMED table. Unfortunately I have been unable to update the CLAIM table with the RetentionDate from the form due to integrity constraints on the primary key. The SQL I have used for this is as follows:
UPDATE CLAIM SET RetentionDate = [Forms]![BULL PREMIUM]![RetentionDate]
WHERE CLAIM.Form_num = [Forms]![BULL PREMIUM]![Form_num];
I have tried using an INSERT query but this is also incorrect. Could anyone shed any light on how to solve this problem?
Also when I refresh the form the combo box has the last value selected still in it, even though the selection has been removed from the list. Is there a way of replacing this with a caption, such as "Select eartag number"?
Many thanks
Chris
The form_num is a foreign key in another table called CLAIMED which also holds an eartag_num.
I have used two text boxes on the form holding these attributes and a combo box to select the eartag number which will be inserted into the CLAIMED table.
I have then got a button which inserts the appropriate values into the CLAIMED table. Unfortunately I have been unable to update the CLAIM table with the RetentionDate from the form due to integrity constraints on the primary key. The SQL I have used for this is as follows:
UPDATE CLAIM SET RetentionDate = [Forms]![BULL PREMIUM]![RetentionDate]
WHERE CLAIM.Form_num = [Forms]![BULL PREMIUM]![Form_num];
I have tried using an INSERT query but this is also incorrect. Could anyone shed any light on how to solve this problem?
Also when I refresh the form the combo box has the last value selected still in it, even though the selection has been removed from the list. Is there a way of replacing this with a caption, such as "Select eartag number"?
Many thanks
Chris