comparing field data from previous field in loop with null values

A

abbylee26

Im comparing values in a field while doing a loop
if sAct<>myData(5,i) then
At the end of the loop I make the value of sAct equal the current
myData

This will work when comparing other fields withing my recordset (so I
know the statement works) but it will not work for the field I want to
compare. The only difference with this field is that it has null
values. Could this be the problem? if so, how do I deal with nulls?
 
A

abbylee26

I should say my code works but just completely ignors null values. I
need it to treat nulls like anything else. My code will catch when it
changes from A11 to B17...I also need for it to catch a change from G38
to null

sAct<>myData(5,i)

What do I need to change?
 
B

Bob Barrows [MVP]

Im comparing values in a field while doing a loop
if sAct<>myData(5,i) then
At the end of the loop I make the value of sAct equal the current
myData

This will work when comparing other fields withing my recordset (so I
know the statement works) but it will not work for the field I want to
compare. The only difference with this field is that it has null
values. Could this be the problem? if so, how do I deal with nulls?

if sAct<>myData(5,i) & "" then
 
A

abbylee26

if sAct<>myData(5,i) & "" then

This doesn't seem to work...even so the statement wouldn't really work
here anyway.

If for example sAct is null and myData(5,i) has a value, this statement
would not pick up on the change. I need this trigger to go off if there
is any change between the two objects.
 
E

Evertjan.

wrote on 14 feb 2006 in microsoft.public.inetserver.asp.general:
if sAct<>myData(5,i) & "" then

This doesn't seem to work...even so the statement wouldn't really work
here anyway.

If for example sAct is null and myData(5,i) has a value, this statement
would not pick up on the change. I need this trigger to go off if there
is any change between the two objects.

if (sAct & "") <> (myData(5,i) & "") then

[This will see a null and an emplty string as the same.]
 
B

Bob Barrows [MVP]

if sAct<>myData(5,i) & "" then

This doesn't seem to work...even so the statement wouldn't really work
here anyway.

Then, I'm sorry, but you're going to have to do a better job of describing
what "doesn't work" means. What I posted was a stab based on what I guessed
you meant.
If for example sAct is null and myData(5,i) has a value, this

Oh come on!

if sAct & "" <>myData(5,i) & "" then
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top