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

Write Conflicts when updating fields on different sub-forms that point to the same table

Status
Not open for further replies.

egstatus

Programmer
Apr 14, 2005
143
0
0
US
Hi everyone,
I have a table that contains approximately 200 fields.
I have a main form with 4 sub-forms. Each of the sub-forms access about 50 fields of the table. Each of the sub-forms record source use the same table.

I have a toggle button where I change from one sub-form to the others. What I do is just make the other form invisible while making the one they selected visible.

There are fields on each sub-form that get calculated as information on the other sub-forms are filled in.

I am running into a problem so when I change something on sub-form 1 for example and then I go to sub-form 2 and change something on sub-form 2. I get a "Write Conflict Error. This record has been changed by an other user since you started editing it. If you save the record you will overwrite the changes the other user made."

What Am I doing wrong here? I can't brake the table into smaller tables.

I am open to suggestions.

Thanks

Ed
 
Hi Duane,
If you had no other option but the one I had explained. How would you tackle it?

My thoughts were to create a copy of the current record into temp tables and them point each of the copies to each of the sub forms. Then when I'm done creating/editing the forms update the record of the main table with the copies I created [Just the fields for each of the section that are associated with each form].

Thanks

Ed
 
How are ya egstatus ...

If I were you ... all four subforms would have unbound controls. This would alleviate the error. Its then a simple matter of a single button or event (with code) to save the entire record. You'll need looping structures for this one.

Cheers!

See Ya . . .

Be sure to see FAQ219-2884 Worthy Reading! [thumbsup2]
Also FAQ181-2886 Worthy Reading! [thumbsup2]
 
This should work. Like Duane states when you make the form invisible first set the dirty property to false committing your changes. Something like
dim subFrm as access.form
set subFrm = me.somesubformcontrol.form
subFrm.dirty = false

 
I have broken down my one table into 4 different tables and use each of those table for each of the subforms.

So far its working as intended but I'm still in a testing state.

I thank you all for your suggestions.

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top