Change one field when another field changes?

Change one field when another field changes?

Post by Frank Burlei » Sat, 04 May 1996 04:00:00



Two related questions:

1. What is the best way to *automatically* trigger a change to a field
in a record when *any* other field has changed?  I'd want to have the
change reflect in both the record and in the data-aware control for
the affected field (it could be that changing the data-aware control
would be enough since the content would presumably wind up in the db
field).

An example would be a Last Changed field on an address record.  If an
edit happens, I'd want the Last Changed field to flip to today's date
on the first edit to any part of the record.

2. Now a the narrower case: we want to change one field only when a
specific other field (or data-aware control) changes.

Ideas appreciated, thanks.

--
Frank Burleigh 812-333-7082 (h); 812-855-9170 (o); 812-855-0555 (fax)
School of Law 254, Indiana University, Bloomington, IN  47405

 
 
 

Change one field when another field changes?

Post by Marcus.Shirr.. » Mon, 06 May 1996 04:00:00




Quote:>Two related questions:

>1. What is the best way to *automatically* trigger a change to a field
>in a record when *any* other field has changed?  I'd want to have the
>change reflect in both the record and in the data-aware control for
>the affected field (it could be that changing the data-aware control
>would be enough since the content would presumably wind up in the db
>field).

>An example would be a Last Changed field on an address record.  If an
>edit happens, I'd want the Last Changed field to flip to today's date
>on the first edit to any part of the record.

>2. Now a the narrower case: we want to change one field only when a
>specific other field (or data-aware control) changes.

>Ideas appreciated, thanks.

You might try using the onchange event for a dbtable and then checking which
fields have changed from their previous values.

Just a suggestion, it may not work.