Write Conflict Errors In Access Form (2000)

S

SEAN DI''''ANNO

Hi...feel a little out of my depth here.

I have a form based on a table called prospects.
It has information such as Company, Address, Postcode etc. The key field is
prospect No

On the same form, I have a sub form over the top, called Town_View.
this form also has the same data source of Prospects.

On this form, It shows just the company name and town but in a bigger font.
At the bottom of the form there is a toggle button so that the user can
wither see the address in a full view or town view. (This is setting the
scene for my problem).

if I click to the main form and change data I have no problems,
if I click on the Town Viw Sub (form which is the start up view. When I
make changes to the fields etc, I get a write conflict error when I try and
leave the record. i.e. Save, Copy Drop Changes.

I know the problem is that I have two forms both ref. the same data set and
fields (I assume) and need some kind of Temp. copy of the record if Im
working in a town view mode but am not sure how to go about this or how to
update the main prospect record afterwards. Can some one help me please?
 
M

Maurice

The problem is that the first form is still "dirty" when you access the
second form. What you need to do is to set the form to dirty=false when you
want to go to the second form. Ofcourse there's a disadvantage to that
because it will save the record immediately and it could be the case that you
don't want that just yet. In that case you should consider using a .tmp table
but this is far from ideal in this situation. I would go for the dirty=false
option.

hth
 
S

SEAN DI''''ANNO

Hi Maurice,

I had never heard of this property before. lol I have been practicing this
at home. I set up a basic form with a few fields and called it Mainform. I
then copied the form and called it subform. Finally I linked the subform to
the main form. When i changed a value in the subform it did not change the
same value in the main form. But as you suggested, when I use me.dirty=false
in the after update of the control...for example Town...it then updates Town
In the main form which is great.

Can I ask a few questions so I properly understand this property.
On my main database at work I have on my form some controls which score the
prospect such as Location, Product Range etc. and then a total Score. E.g
Location 5, Product Range 5. As each score is changed, The Total Score
then changes via a function. On my subform the user is able to change the
scores as well but, the score on the main form does not change.


My questions are this;
1 - You said, I need to use the Dirty when i go to (Make visible via the
toggle button) my Town View form (Sub-Form). Do you mean, for example for
the subform On Focus event set Me.Dirty=False? or can I not just use this
property after each item update e.g. Town, Location-Score etc. on the subform?

2 - I have looked up what this property is and it still does not make much
sense, do I need to set it back i.e. Dirty=True and if so where?

Your help has been greatly appreciated...I just need....want to know why it
works and where exactly I can or should use this property

Thanks in advance.
 
S

SEAN DI''''ANNO

Maurice.....this is my whole problem which I hope makes better sense.

I work for Brady (Seton to be exact) and I know we use your training quite a
lot. On the whole I am quite proficient in Excel and Access but am
struggling with a particular issue which Chris Aspley said, I should throw
your way to see if you could assist.


I have an access form called frmProspectTabControl and the record source is
a table called prospects On it are lots of address fields as well as some
fields called (i'll keep it simple), Score1, Score2, Score3. As each score
is changed, a function is run to work out the total score which is also stored



Form_frmProspectTabControl!Score =
Form_frmProspectTabControl!Score_Market_Interest +
Form_frmProspectTabControl!Score_Other +
Form_frmProspectTabControl!Score_Synergy_Potential +
Form_frmProspectTabControl!Company_Size



This works fine. Ps, the function does other pretty stff too which is why
its stored in a function !!



This where I have problems,



I have a subform on top of frmProspectTabControl called town view which is
based on the same data source. On this form, I have the same score fields as
above and the town too.



I have done this so that the user can see in a magnified view, just the
prospect scores and the town or all of the address and the scores. I control
visibility by having a toggle button (I.e. Town View Visible Yes or No).



This is where I get problems, if I change the scores or other details on the
main form...the function works and the total score changes. If I change the
score in the sub-form, the function does not work and I get a message when I
try and leave the form of,Write Conflict, Drop, Save Changes, Save To
Clipboard.



I did change the after update event of each control on the form to
(me.Dirty=False not sure why this works but was told to use it lol) which
stops me getting the Write conflict errors but when the function is run (also
after the after update)...it falls over at the above code (changing total
score) with a message of values have been changed.



Can you tell me what I do or change to make this code work properly please?







Kind regards





Sean Di'Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

write conflict 2
Write Conflict error (Access 2007) 1
Write Conflict 6
Write Conflict 2
Write Conflict 8
Simple Copy Button 1
cant edit in my form, write conflict problem? 2
general conflict question 1

Top