E
Ernie
I need your help ...please!!!
Can anyone tell me why I'm getting the following write conflict error when I
try to insert a new record in a SQL Server table:
""This record has been changed by another user since you started editing it.
If you save the record, you will overwrite the changes the other user made.
Copying the changes to the clipboard will let you look at the values the
other user entered, and then paste your changes back in if you decide to make
changes.""
There is an UPDATE trigger on the table I'm updating and if I remove it I do
not get the conflict error. If I click "Discard Changes" and then refresh,
the data is in both tables.
I assume the problem is in the trigger rather than the forms because I can
get the same error trying to enter data directly into the table.
This is the trigger code:
ALTER TRIGGER tblclaimaction_insert
ON dbo.tblclaimaction
FOR INSERT
AS
INSERT INTO dbo.tbllineclaimamount
(tbllineID, actiondate, parts, labor, misc, cstpart,
dlrpart, comments)
SELECT tbllineID, actiondate, parts, labor, misc, cstpart, dlrpart,
comments
FROM inserted
WHERE (tbllinestatusID = 15) OR
(tbllinestatusID = 16) OR
(tbllinestatusID = 22)
INSERT INTO dbo.tblacesdetail
(tbllineID, tbllinestatusID, actiondate, parts, labor,
misc, cstpart, dlrpart, comments, tblacesID)
SELECT tbllineID, tbllinestatusID, actiondate, parts, labor, misc,
cstpart, dlrpart, comments, tblacesID
FROM inserted
WHERE (tbllinestatusID = 10) OR
(tbllinestatusID = 11) OR
(tbllinestatusID = 12) OR
(tbllinestatusID = 14) OR
(tbllinestatusID = 17) OR
(tbllinestatusID = 18) OR
(tbllinestatusID = 19)
UPDATE tblline SET tbllinestatus = tbllinestatusID
FROM inserted
Where tblline.tbllineID = inserted.tbllineID
This trigger is basically copying the data entered into the first table
(tblclaimaction) one of the other tables (tblacesdetail) or
(tbllineclaimamount), dependant on the data entered. I have a time stamp
field in the first table and have tried the trigger with/without copying the
timestamp. What I do notice though, is there is no value in the time stamp
field. What's with that?
Any assistance would be greatly appreciated!
Can anyone tell me why I'm getting the following write conflict error when I
try to insert a new record in a SQL Server table:
""This record has been changed by another user since you started editing it.
If you save the record, you will overwrite the changes the other user made.
Copying the changes to the clipboard will let you look at the values the
other user entered, and then paste your changes back in if you decide to make
changes.""
There is an UPDATE trigger on the table I'm updating and if I remove it I do
not get the conflict error. If I click "Discard Changes" and then refresh,
the data is in both tables.
I assume the problem is in the trigger rather than the forms because I can
get the same error trying to enter data directly into the table.
This is the trigger code:
ALTER TRIGGER tblclaimaction_insert
ON dbo.tblclaimaction
FOR INSERT
AS
INSERT INTO dbo.tbllineclaimamount
(tbllineID, actiondate, parts, labor, misc, cstpart,
dlrpart, comments)
SELECT tbllineID, actiondate, parts, labor, misc, cstpart, dlrpart,
comments
FROM inserted
WHERE (tbllinestatusID = 15) OR
(tbllinestatusID = 16) OR
(tbllinestatusID = 22)
INSERT INTO dbo.tblacesdetail
(tbllineID, tbllinestatusID, actiondate, parts, labor,
misc, cstpart, dlrpart, comments, tblacesID)
SELECT tbllineID, tbllinestatusID, actiondate, parts, labor, misc,
cstpart, dlrpart, comments, tblacesID
FROM inserted
WHERE (tbllinestatusID = 10) OR
(tbllinestatusID = 11) OR
(tbllinestatusID = 12) OR
(tbllinestatusID = 14) OR
(tbllinestatusID = 17) OR
(tbllinestatusID = 18) OR
(tbllinestatusID = 19)
UPDATE tblline SET tbllinestatus = tbllinestatusID
FROM inserted
Where tblline.tbllineID = inserted.tbllineID
This trigger is basically copying the data entered into the first table
(tblclaimaction) one of the other tables (tblacesdetail) or
(tbllineclaimamount), dependant on the data entered. I have a time stamp
field in the first table and have tried the trigger with/without copying the
timestamp. What I do notice though, is there is no value in the time stamp
field. What's with that?
Any assistance would be greatly appreciated!