Subform Save Record Problem

mbentley

Registered User.
Local time
Today, 00:44
Joined
Feb 1, 2002
Messages
138
I have a form that contains 3 subforms. Whenever I add or change a record in the subform and then close the main form, move to another record in the main form, or even just click into a field on the main form I get a Write Conflict error (see attached image). Funny thing is that although it happens with every subform, it doesn't always happen and I can't find a pattern to when it will happen. I'm guessing it has something to do with the way Access locks records, but I can't figure out how to circumvent this.
 

Attachments

  • error.jpg
    error.jpg
    18.3 KB · Views: 166
Force a record save and that should do the trick. You can use DoCmd.RunCommand acCmdSaveRecord but where you use it will be up to you...

hth,
Jack
 
Thanks for the reply. I'd actually tried that, but my problem is that I can't figure out whether it's the form or subform that's triggering the error. I've tried tying the command to a number of different events to no avail. I was hoping there was a structural away around it rather than forcing a save that the user may not want.
 
The only way that I have been able to cure this was with a save. The form I had had tabs and many subforms so it took a long time to find out just what I needed to do, but once I put in the save all was well. I think you are just going to have to step through your code until you get the error then you can backtrack from there and add the save.
 
Update to Problem

I've been plaing with this a little more with no success, but I've discovered something that may help.

When I make changes to the subform, both the subform and main form become dirty. If I manually save the record within the subform (SHIFT+ENTER), it is no longer dirty, but the main form remains dirty. When I then try to exit the subform by clicking into any other part of the main form, I trigger the Write Conflict error.

I've tried attaching the SaveRecord command to the OnExit event of the subform, but it doesn't change anything.

What baffles me is that no code is executing and nothing is supposed to be saving at the time this error fires.

Help! :confused:
 
Ever get a resolution on this issue? am having similar
 
Not so far. I'm betting it has to do with record-level locking, but I haven't played with it in a while.
 

Users who are viewing this thread

Back
Top Bottom