[dba-VB] Visual Basic Form - Check If Recordset/Field NeedsUpdating

Doris Manning mikedorism at verizon.net
Thu Feb 8 11:28:11 CST 2007


I never noticed the .datachanged property.  I'll have to look into that one
myself because it would make things a lot easier.

Doris Manning
Database Administrator
Hargrove Inc.

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Perry L Harold
Sent: Thursday, February 08, 2007 11:47 AM
To: paul.hartland at fsmail.net; dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] Visual Basic Form - Check If Recordset/Field
NeedsUpdating

Paul

For form controls (have only tried this with text boxes) I set the tag
value to the value of the control when the form is loaded.  When the
focus goes away from the current record I compare the control's value to
the tag value and if they are different set the .datachanged value to
true.  If any control has a .datachanged value of true then update the
record with the new values.  If they aren't different then no update is
done.  (The datachanged flag is set to true when the control is
populated so it needs to be reset to false after populating the form
with the selected record.  Any keystrokes also set .datachanged to true
- so no comparison is done until checking against the tag)

You can copy the tag value to the log file as the original value for any
control that has the .datachanged value of true and the control's
current value as the new value.  The field name, etc for that control
could also be logged at the same time.


Perry Harold
Professional Testing Inc


-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of
paul.hartland at fsmail.net
Sent: Thursday, February 08, 2007 2:26 AM
To: accessd; dba-vb
Subject: [dba-VB] Visual Basic Form - Check If Recordset/Field Needs
Updating
Importance: High

To all,

Firstly my appologies for cross-posting this on the Access site, the
reason for this is I haven't seen much (well very very little to be
precise) activity on the VB Group.

I am after some advice really, basically I would like to know the best
way to check if a recordset/field needs updating.  Say if a user has a
client record in front of them and doesn't make any changes I need to
detect this so I don't have to bother to update any recordsets/fields,
but if the user does make a change to any textbox/checkbox/dropdown etc
I would like to detect this so that :
    1. I can update the recordset/field
    2. So I can create a log of the record the user changed (plus if
possible the name of the field and what they changed it from and to).
So any help on this will be appreciated, I have come up with a couple of
solutions but the one seems long winded and the other, I just can't get
to work quite right.

Thanks in advance for any help on this.

Paul Hartland
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com






More information about the dba-VB mailing list