Editing a saved record from a linked table w/o leaving it

K

kfguardian

I have a linked table to an SQL server. If I save the record on my form with
a button and then try to edit more info I get the following error: "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. <ok>"

If I hit ok, all the fields show #Deleted. How do I get around this? I
know I am the only user because I am still developing the form?
 
G

Graham Mandeno

Hi kfguardian

What code does your button execute to save the record?

Either
Me.Dirty = False
or
DoCmd.RunCommand acCmdSaveRecord

should save the record and not give you any error when you try to make
further changes.
 
K

kfguardian

I use
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

And if I use a copy of the linked table for the purposes of working at home
it is fine. But as soon as I use the linked table I get this error. If I
leave the record and come back to it to make changes it is ok (I believe
anyway- can't test today).

Graham Mandeno said:
Hi kfguardian

What code does your button execute to save the record?

Either
Me.Dirty = False
or
DoCmd.RunCommand acCmdSaveRecord

should save the record and not give you any error when you try to make
further changes.
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

kfguardian said:
I have a linked table to an SQL server. If I save the record on my form
with
a button and then try to edit more info I get the following error: "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. <ok>"

If I hit ok, all the fields show #Deleted. How do I get around this? I
know I am the only user because I am still developing the form?
 
K

kfguardian

I figured it out, it needed a primary key in the table.

kfguardian said:
I use
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

And if I use a copy of the linked table for the purposes of working at home
it is fine. But as soon as I use the linked table I get this error. If I
leave the record and come back to it to make changes it is ok (I believe
anyway- can't test today).

Graham Mandeno said:
Hi kfguardian

What code does your button execute to save the record?

Either
Me.Dirty = False
or
DoCmd.RunCommand acCmdSaveRecord

should save the record and not give you any error when you try to make
further changes.
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

kfguardian said:
I have a linked table to an SQL server. If I save the record on my form
with
a button and then try to edit more info I get the following error: "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. <ok>"

If I hit ok, all the fields show #Deleted. How do I get around this? I
know I am the only user because I am still developing the form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top