onchange: paste contents into another column

  • Thread starter Mitchell_Collen via AccessMonster.com
  • 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
 
J

John W. Vinson

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.
 
M

Mitchell_Collen via AccessMonster.com

Thanks so much for helping me. This works really great!
-Misty
 

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