Prevent updates to field after change to parent table

  • Thread starter Thread starter James
  • Start date Start date
J

James

Using MS Access 2000 how do I retain boolean values
following changes to those values at a later date? ie if I
link a checkbox control in a form linked to the value in
another form and subsequently change the parent boolean
setting how do I keep the checkbox boolean value after the
parent value has been changed? I want to retain the
boolean value at a particular time and prevent it changing
later if I have to change the parent table or form's
value....
..
 
Hi James,

I'm not sure that I understand your question. In general, if you want to
store a history of the value of something at different times, you need
to set up another table to do it.

If it's just to track the value of a checkbox at various times, the
table could have just two fields

tblLogCheckboxChanges
Timestamp - date/time (primary key)
TheValue - Yes/No

Then in the form's BeforeUpdate event procedure put code to detect and a
change in the checkbox's value. This is untested air code:

Dim dbD as DAO.Database

With Me.ckTheCheckbox
If .Value <> .OldValue Then 'it's changed
Set dbD = CurrentDB()
dbD.Execute "INSERT INTO tblLogCheckboxChanges " _
& "(Timestamp, TheValue) VALUES (#" & Now() _
& "#, " & .Value & ");"
End If
End With
 
John,

Thanks for your reply - you did understand the question
and I was on a similar track. It appears I need a history
table to track the boolean value in time and store that
data. I'll give it a shot - Cheers.
-----Original Message-----
Hi James,

I'm not sure that I understand your question. In general, if you want to
store a history of the value of something at different times, you need
to set up another table to do it.

If it's just to track the value of a checkbox at various times, the
table could have just two fields

tblLogCheckboxChanges
Timestamp - date/time (primary key)
TheValue - Yes/No

Then in the form's BeforeUpdate event procedure put code to detect and a
change in the checkbox's value. This is untested air code:

Dim dbD as DAO.Database

With Me.ckTheCheckbox
If .Value <> .OldValue Then 'it's changed
Set dbD = CurrentDB()
dbD.Execute "INSERT INTO tblLogCheckboxChanges " _
& "(Timestamp, TheValue) VALUES (#" & Now() _
& "#, " & .Value & ");"
End If
End With

Using MS Access 2000 how do I retain boolean values
following changes to those values at a later date? ie if I
link a checkbox control in a form linked to the value in
another form and subsequently change the parent boolean
setting how do I keep the checkbox boolean value after the
parent value has been changed? I want to retain the
boolean value at a particular time and prevent it changing
later if I have to change the parent table or form's
value....
.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top