The Dirty Property

diannosd

Registered User.
Local time
Today, 00:40
Joined
Feb 14, 2008
Messages
11
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

Code:
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 stuff 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?
 
The Dirty Problem

Relatively new to this stuff myself however it sounds like you have two fields on seperate forms accessing the same data. Modify one and the other has the wrong data displayed. Why not use unbound fields on the subform and then copy the contents from the main form. When you close the sub form do a copy back of the modified data.

...or I might be totally out in left field.

Cheers.
 

Users who are viewing this thread

Back
Top Bottom