Old value, New Value

C

Chris

Hello,

I am trying to build an audit table for my db. Does a textbox control have
an old or original value property. Currently, when a form loads I am holding
original values of the controls on that form in gobal variables in a module
and then write the old and new values of the controls to an audit table. Any
Ideas?

Thank you
 
J

Jonathan Parminter

-----Original Message-----
Hello,

I am trying to build an audit table for my db. Does a textbox control have
an old or original value property. Currently, when a form loads I am holding
original values of the controls on that form in gobal variables in a module
and then write the old and new values of the controls to an audit table. Any
Ideas?

Thank you
.
Hi Chris,
a control has a .value property that stores the
current/new value and a .oldvalue property that stores the
previous value.

Luck
Jonathan
 
J

Jonathan Parminter

Hi Chris,
a control has a .value property that stores the
current/new value and a .oldvalue property that stores the
previous value.

Luck
Jonathan
.

Chris,

just wanted to add that you will need to utilise
the .oldvalue property during or before the
form.beforeupdate event. Once the record is
saved .oldvalue and .value become the same value.

Luck
Jonathan
 
J

John Vinson

Hello,

I am trying to build an audit table for my db. Does a textbox control have
an old or original value property. Currently, when a form loads I am holding
original values of the controls on that form in gobal variables in a module
and then write the old and new values of the controls to an audit table. Any
Ideas?

Yes; but only in certain events. For example, in the Form's
BeforeUpdate event you can refer to

Me!txtMyTextbox.Value
or
Me!txtMyTextbox.OldValue

In the AfterUpdate event, however, the data has already been written
to disk and the OldValue property is no longer available.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top