write conflict error



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!

.



Relevant Pages

  • Re: write conflict error
    ... remote programming and training ... I was hoping to avoid adding the code to all of the forms that use that table as the record source by using the trigger on the table. ... The correct data goes into the other two tables and no errors are recieved which makes me think that it is something that is happening in Access when interfaced with SQL database. ... (tbllineID, tbllinestatusID, actiondate, parts, labor, misc, cstpart, dlrpart, comments, tblacesID) ...
    (microsoft.public.access.modulesdaovba)
  • Re: write conflict error
    ... If I remove the update trigger on the table I do not get the error on the table or the form. ... Ff you have comboboxes or listboxes getting criteria from a query based on the SQL Server table you are trying to update that get their criteria from your form, use the form OnCurrent event to rewrite the SQL in the combo/listbox. ... SELECT tbllineID, actiondate, parts, labor, misc, cstpart, dlrpart, comments ... WHERE (tbllinestatusID = 15) OR ...
    (microsoft.public.access.modulesdaovba)
  • Re: write conflict error
    ... This code is launched automatically by the SQL server when a record is ... extra work if a trigger will do the same thing. ... MVP Microsoft Access ... WHERE (tbllinestatusID = 15) OR ...
    (microsoft.public.access.modulesdaovba)
  • Re: write conflict error
    ... instead of executing on the SQL side, put the SQL statements in the code behind the form. ... MVP Microsoft Access ... This code is launched automatically by the SQL server when a record is inserted into that table, hence the name "Update Trigger" and why I can get the error when I update directly to the table without using a form. ... (tbllineID, tbllinestatusID, actiondate, parts, labor, misc, cstpart, dlrpart, comments, tblacesID) ...
    (microsoft.public.access.modulesdaovba)
  • Re: write conflict error
    ... The trigger works fine without errors when I append data into that table ... something that is happening in Access when interfaced with SQL database. ... MVP Microsoft Access ... (tbllineID, tbllinestatusID, actiondate, parts, labor, ...
    (microsoft.public.access.modulesdaovba)

Loading