Re: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- From: "David W. Fenton" <XXXusenet@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 15 Dec 2005 14:19:58 -0600
"daniel" <danielblw@xxxxxxxxx> wrote in
news:1134667506.911789.241680@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
> yeah, I updateing the files exist on the form.
> public sub cal()
> squery = "SELECT * from Table1 where serial = " & !Serial
> Set rs = db.OpenRecordset(squery, dbOpenDynaset, dbSeeChanges)
>
> With rs
> .Edit
> !Field1 = 10
> .Update
> End With
>
> end sub
> when I change field2 on the form, I call Cal(). If i change
> field2 again, then the error shows up.
Why are you using a separate recordset to update data that is
already opened in the recordset behind the form you're using to edit
it?
Secondly, if you *are* going to update the data through something
than the obvious method of changing the form's underlying data, why
in the world are you opening a recordset with .Edit and .Update
instead of just using a SQL UPDATE query:
UPDATE Table1 SET Field1=10 where serial = " & !Serial
That will be faster and hold a lock on the table a shorter period of
time.
But I question why you are doing this in the first place.
Why not just update the field in the form's underlying recordset?
Doing it your way is just asking for exactly the kind of problem
you're seeing.
--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
.
- Follow-Ups:
- References:
- The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- From: daniel
- Re: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- From: salad
- Re: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- From: daniel
- Re: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- From: salad
- Re: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- From: daniel
- The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- Prev by Date: Re: ftp from Access: problems
- Next by Date: Re: Healing
- Previous by thread: Re: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- Next by thread: Re: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record
- Index(es):
Relevant Pages
|