onchange: paste contents into another column

  • Thread starter Thread starter Mitchell_Collen via AccessMonster.com
  • Start date Start date
M

Mitchell_Collen via AccessMonster.com

I am making an update form. I want the form to onchange of CurrentPrice,
store CurrentPrice in OldPrice column. Is there are query or way to do this
in Access?

So when the user starts to enter data in CurrentPrice, then the program
pastes whatever is in CurrentPrice into OldPrice. I will create some way to
update the time when record changed.

Please help me if you know how to do this.
Thanks, Misty
 
I am making an update form. I want the form to onchange of CurrentPrice,
store CurrentPrice in OldPrice column. Is there are query or way to do this
in Access?

So when the user starts to enter data in CurrentPrice, then the program
pastes whatever is in CurrentPrice into OldPrice. I will create some way to
update the time when record changed.

Please help me if you know how to do this.
Thanks, Misty

The Change event's name is misleading. It fires *at every keystroke* while the
field is being edited. I think you want to use the AfterUpdate event of the
CurrentPrice field:

Private Sub CurrentPrice_AfterUpdate()
Me!OldPrice = Me!CurrentPrice.OldValue
Me!WhenUpdated = Now
Me!ByWhomUpdated = CurrentUser
End Sub

The OldValue property contains the contents of the field before the user
started editing it. If you have the additional controls WhenUpdated and
ByWhomUpdated the other lines will fix them as well. Note that this will not
keep an audit trail history - if there are fields WhenUpdated and
ByWhomUpdated in your table, they will record only the single most recent
change.
 
Thanks so much for helping me. This works really great!
-Misty
 
Back
Top