problem with empty fields in iff statement

undergrad

Registered User.
Local time
Today, 04:47
Joined
May 29, 2003
Messages
25
hello,

i am trying to track changes. i have succeded so far and am quiet proud of myself. however, i am having trouble getting this to work for previously blank fields. for everything else it adds "oldvalue=[whatever the oldvalue was]", but for previously blank enteries it only adds a blank field.

why wont access enter "oldvalue= " when the previous value is blank?


this is my expresion for the owner field on the append table query

Expr10: IIf(NewValue!Owner=OldValue!Owner,Null,"oldvalue="+OldValue!Owner)

any help would be much appreciated.
thanks!
 
Null=Null does not exist. you cannot compare Null to Null!

Eliminate nulls before you do the calculation
eg

Expr10: IIf(Nz(NewValue!Owner,0)=nz(OldValue!Owner,0), Null, "oldvalue="&OldValue!Owner)

There is a difference between + and &

& will add / concatenate whatever
+ will not process if there is a null present (almost like a conditional add / concatenation)

does this help?
 
thank you so much. i guess i was getting hung up on using + as opposed to using &. i saw an example on here were they combined stuff on a field with + and i just went with that. my access knowledge although broad is patchy.

anyway thanks fizzio!
 

Users who are viewing this thread

Back
Top Bottom