Re: Me.Dirty - Where to put this logic?



In 6f2357ee0d2e1@uwe">news:6f2357ee0d2e1@uwe,
ar013871 via AccessMonster.com <u23484@uwe> wrote:
Okay,

Here is the setup of this monster database that we're using. We have
an Access frontend with SQL server backend. We have about 14 tables
that all link to one main table via main table's PK. To present this
data, we have forms that have 14 sub-forms on them (long story, but
in order to get what we needed, this was how we got it to work). We
have the SQL server residing on one server and then six laptops
connect to that server via wireless router (again, due to the
mobility of the laptops, it has to be wireless). So at one time,
there are six users entering data, but never working on the same
person at the same time. Lately we've been experiencing, what seems
to be a common error, the write conflict error where the only options
are Save, Copy to Clipboard or Drop Changes. With me so far?

Okay, so it is my understanding that as a user tabs through the form
and fills out the appropriate text boxes, check boxes, and option
buttons, the record does not save until the form is closed, correct?
This is when the record is considered "dirty," it's there but not
written to SQL. In doing some research, it looks like I need to
utilize the following logic:

If Me.Dirty = True Then
Me.Dirty = False
End If

My question is where to do I put this? Do I put in in the OnExit
event of the subform? Does it go in each AfterUpdate event for each
control on the form (this would be ridiculous (there's thousands))?
Does it go in the AfterUpdate event of the main form? With this
setup, I can set many places to put it, I just need to make sure it's
in the right spot so the error goes away. Please let me know.

When the focus changes from the main form to a subform, the main form's
record will be saved automatically if the form is dirty. When the focus
changes from a subform to the main form, the subform's record will be
saved automatically, if the subform is dirty. So there's no point in
trying to save records as you switch between main form and subform.

Is it taking the users a long time to fill out the form or subform, so
that the record remains dirty for a long time? You say that the users
are never "working on the same person at the same time." Given that you
have a SQL Server back-end, I'm not sure why you're getting write
conflicts, unless "working on a person" involves updating records that
may be in common between two "persons". That is, unless your problem
isn't really one of true write conflicts, but rather a configuration or
data problem that is causing Access to *think* there's a write conflict
when there really isn't. Do you get these conflict messages all the
time, or only occasionally? Do they really seem to correspond to
situations where users are updating the same records?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.