Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange problem with Update

Status
Not open for further replies.

darkwraith

Programmer
May 26, 2003
44
IT
Hi, I have a problem I can't work out: I have some forms through which I can update records in my Access 2000 tables.
Sometimes a strange thing occurs: if, after I updated a record in a table, I try to update the same record another time in the same session a warning appears that says that "The record has already been changed by another user....." and asks me if I want to Save the new record or not. If I select Save, the record gets corrupted and I cannot even manually cancel it from the table (it cannot find the record key to be cancelled).
Anyone had this problem before? How can I work it out?
 
Do you update it in more than one way? ie: Using controls on the form; or using recordset clones.

I've experienced this when I allow users to make changes to data on a form and then they press a button on a toolbar which then does work with those records. Always do something like the following line before going off and doing lots of work using recordsets...

Code:
If Me.frm_DataLoad_subDataSheet.Form.Dirty Then DoCmd.RunCommand acCmdSaveRecord

I've done this in Access97. Not sure about Access2000.

Regards,
Mark.
 
Hi Mark,
thank for the suggestion.
It was as you said, actually.
I made more than one change to the same record: infact I had a textbox associated with a field in a table and, each time I changed its value on the form, it changed in the table. Then I had a pushbutton which executes an Update sql statement in the same table.
By now I have removed the connection between the table field and the textbox and I fill it with the right value each time I pass to a new record, so to update the single record only when the pushbutton is clicked.
I have another form with the same problem, I will use the 'Dirty' event to sense when a change has been done and then save it. I think it's the same both in Access 97 and in Access 2000.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top