Write Conflict

Tupacmoche

Registered User.
Local time
Today, 06:25
Joined
Apr 28, 2008
Messages
291
Hi Form Masters,

I have a form that handles most of the fields in a table but some of the fields are on a separate form that segregates the fields logically and are entered into another form. The relationship of this information is one to one with the information on the main form so they are in the same table. The problem is that after clicking a button to open the form and add it, I get the error message that, I have attached 'Write Conflict' ... the record has been changed by another user. This is in fact the same user. How can this issue be over come with out having to create a new table just to enter this information? I actually have a few forms that handle information this way and the same thing happens. This will ultimately be a multi- user application so it is critical to resolve this issue. Any suggestions?:eek:
 

Attachments

  • Write Conflict.JPG
    Write Conflict.JPG
    26.2 KB · Views: 88
Having two Forms open, at the same time, Bound to the same Table, is always going to give you this problem.

If the number of Fields require more space and/or you need Fields to be segregated logically, the standard approach to this is to use a single Form and a Tabbed Control, placing the appropriate Fields on different Pages of the Control.

Linq ;0)>
 
The database is split in that they are all linked mssql tables. Can this be split any further?
 
missinglinq,

That is an interesting suggestion. Do you have any examples or links to such?:o
 
Create a form.
Put a tab control with 2 pages on it.
Put one field on the first page.
Put one field on the second page.

That is what an example would look like...
 
missinglinq,

Your solution worked nicely but a control is now miss-behaving. What is interesting is that it worked fine in the not best practice form that, I was using that kept getting 'write conflict' errors. Any way to the problem. On the first tab named Pledge Schedule, I collect the dates and payment up to five and then have a textbox control with the formula:
=Nz(Sum([PP1_Amt]+[PP2_Amt]+[PP3_Amt]+[PP4_Amt]+[PP5_Amt])) that sums them up.
The first odd thing is that there is a value in the textbox even before anything is typed into the five payment amounts on the form. As, I type into the payment amounts their sum is added to whatever number is in the textbox. So, if it has one million in it without anything entered into the five textboxes and if I add one thousand to each textbox it then has one million plus five thousand. When, I check the database it reflects what was entered into each textbox one thousand each. Any idea way this would happen? The old form that, I had was linked to the PK of the main form is a link also needed on a tabbed form to keep them synchronized? :eek:
 
missinglinq,

I did as you suggested, added a tabbed control with 3 tabs on it. But, since my main form is completely full, I placed it on top of the main form and set it's visible method to False. So, when, I need it I turn it on and then have a button on it to turn it off after data entry is done. The problem that I face now is that the tabbed form is not modal so a user can click on the main form and make changes while it is open. Any suggestions on how this can be prevented?:eek:
 
The whole point is to not have a 'main form' and Subforms on the Tabbed Control...you simply have a single Form.

  1. Create a Form
  2. Add a Tabbed Control
  3. Add as many Pages as you need to segregate your Controls logically
  4. Add the appropriate Controls to each Tabbed Page
Understand that we're not talking about adding Subforms to each Page...we're talking about adding the Controls for your Form directly to each Page.

You refer to these Controls as if they were all on a single Form...because they are! Anything you need to do can be done exactly as if they were all on a single, huge Form...because they are on a single Form...they're just not crowded!

Linq ;0)>
 
The method that missingliq suggested works perfectly. No more 'Write Conflict' issues. I start with my main form visible and all the others invisible. When data enter is needed in an other tab it becomes visible and the main tab is made invisible. But this has created a new issue. The following expression worked perfectly before the tabs and now is not:

=Sum(Nz([PP1_Amt])+Nz([PP2_Amt])+Nz([PP3_Amt])+Nz([PP4_Amt])+Nz([PP5_Amt]))

See attached file.

It simply adds up the payment above using the 'On Got Focus' event. But now it has a value in it even before anything is entered into the payment amounts. How can this be fixed? How can I restrict it to the current record?:confused:
 

Attachments

  • Tabbed Form - Pledge Payment.JPG
    Tabbed Form - Pledge Payment.JPG
    80.9 KB · Views: 73

Users who are viewing this thread

Back
Top Bottom