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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write Conflict Problem

Status
Not open for further replies.
Jan 24, 2002
33
CA
I'm having quite a bit og problems trying to get rid of this Write Conflict Error. Maybe someone can figure it out.

This is my dilemna:

I have a Main Form with a subform.
When a user wants to EDIT or ADD a Record, both the Main Form and the subform's Recordsources are changed to temporary tables and information relevant to the current record (in the Main and subform) are copied to the temp tables so that the user can make changes or decide to undo the changes without affecting original tables.

Once information is edited, I run a Docmd.RunSQL command to transfer the new information back to the original tables and set the Recordsource of the Main Form and subform back to the original tables and delete the records in the temp tables. No problems there.

When the record is Edited (meaning the record already exists in the original tables) I do not get any errors. However, when the record is NEW, I get a Write Conflict when attempting to switch the Recordsources to the original tables.

I cut and paste the information from the Write Conflict error and it seems to come from the subform. As if the records from the subform were not saved properly.

After reading quite a few threads I am still at a loss.
I've tried using Docmd.Save and Docmd.Runcommand acCmdSaveRecord but it doesn't work.

What baffles me is that it works when Editing an exisiting record but it gives me a Write conflict when the record is new.

Does anybody have any suggestions? I would really appreciate it.




 
where are you doing the saving
Main
sub
main and sub

Hope this helps
Hymn
 
hya,

i am having the same problem i have a main form with a subform. i am saving from the main form and getting the 'write conflict' msg
i too am not sure how to ammend this problem, any advise would be a great help
 
If you are manipulating data in a current record ie sending it to the printer it wont work each record requires saving Main and Sub if you leave that record and go to an other Access will save it if you remain in that record You Have to Save It

How is up to you
Docmd.Save and/or Docmd.Runcommand acCmdSaveRecord for each seems logical

Hope this helps
Hymn
 
Thanks for the replies,

I have tried to save the records at various levels (Form level, SubForm level) but It still didn't work. In my case, the user makes modifications to the subform and a button is pressed on the main form that triggers changed to the subform. Understanding that, I placed a Docmd.Save on the LostFocus of the subform... but still no positive result. I have even tried changing the code (using DAO, ADODB or Docmd.RunSQL). I'm at a loss.

Hope someone has more luck than I do.

Like I always say: "If you don't succeed...CTRL+ALT+DELETE"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top