Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OldValue Problem

Status
Not open for further replies.

Hmadyson

Programmer
Mar 14, 2001
202
US
I have never run into an error where OldValue is not populated for a form, but now I am.

I have a form that is based upon a query grabbing fields from 2 tables which are inner joined.

Unfortunately, about half of the fields do not have an OldValue but they do have a Value. So I was trying to loop through and compare OldValue to Value, but for these values it says that OldValue is null and that value has a value so my code would write this out as a change.

Unfortunately, I cannot just say that if iserror(oldvalue) then ignore it, because sometimes these fields are the ones with changes.

Has anyone had the same situation? I am in Access 97. Let me know if I am doing something wrong or there is a workaround. I have used this code on many forms, and this is the first one where I am having problems. Plus, this is the first time that I am attached to a form with multiple tables.
 
Hi!

I hope I understand the question correctly. If I do then you can use the following:

If IsNull(YourControl.OldValue) = False And YourControl.OldValue <> YourControl.Value Then
DoYourStuff

This will only do the stuff if the value and old value are not equal and if the old value is not null.

hth


Jeff Bridgham
bridgham@purdue.edu
 
Yes, but I am running into an issue where OldValue is error. It will say that Isnull(oldvalue)=true, but that is not really the case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top