[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Field Old Value

Posted on 2012-09-16
Medium Priority
Last Modified: 2012-09-16
I am trying to get an event to fire only when a fields data is changed.

When a user chooses a (Text) value from a combo box I want to highlight certain fields fonts in red when the data in the combo's field is different from the previous value. I cannot use after update because users sometimes look at the options in the combo and decide the original value was the correct one. in which case I want nothing to happen. Also if after update is used the first selection will trigger the event.

I only want to fire the event if the new data chosen is different from the existing data except where the original value was null. I have tried OldValue but that has some very strange effects depending on what mood access is in.
Question by:DatabaseDek
  • 2
LVL 61

Expert Comment

ID: 38403675
The Old value of a field will work as expected between the time you update the individual control and the time you update the record as a whole.  So after changing the combo and before moving off the record or forcing a record save.

An alternative to using the OldValue property that might work for you is to compare the .Text Property to the .Value property.  You would have to do this in the combo's Change Event.

Take a look at this article:
LVL 61

Accepted Solution

mbizup earned 2000 total points
ID: 38403696
As a side note, what you are asking for is not entirely clear.

If you are trying to differentiate between an edited value and the previous value of that field *while the user is still editing the record, before the record is saved*, you can use a couple of different methods involving OldValue or the .Text property.

However if you need to differentiate between a current value and a previous value after the record is saved, those methods won't work.  If this is what you are trying to do, you would need a history table to store previous values.

Author Closing Comment

ID: 38403803
Part of the problem (Having read your post) is, surprisingly, me. I like everything saved as I am doing it. So if another field refers to the first field in any way I like to save it with either Me,dirty or refresh. Not sure what the difference is?

Thank you for solving a very frustrating problem

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question