Testing value list

Testing value list

Post by Eri » Tue, 08 Jul 2003 23:28:13



Hi,

I have a field which contains a value list with the values "1" and "2"
(not numbers, text). I have a script that test all the records to
ommit all the records where the field = "2".  The problem is that some
records with the value "2" are still not ommited. I tried to do an if
and a case but it didn't work.

thanks

 
 
 

Testing value list

Post by LaRett » Wed, 09 Jul 2003 01:56:49


Hi Eric,

If you list out your script it would help.  BTW, why aren't you just
doing a find on '1'?  Wouldn't that be easier?  Just a thought!

Also, are you in multi-user environment?  Omit can cause unexpected
results in mutli - I've heard.   :)

What are you using for the value list?  If it's checkboxes, maybe
someone is entering both values.  Even with radio buttons, it's
possible to click BOTH - I forgot the exact command to make that
happen, but it's possible.

Also, can someone change the value in your value list?  Do you have
'member of value list' and 'strict' clicked?  Maybe it's a (space) 2.
Have you checked the data in the fields to be sure they contain only a
2?  What happens if you 'manually' find '2' and omit?

LaRetta

--
Posted via http://dbforums.com

 
 
 

Testing value list

Post by Rien » Wed, 09 Jul 2003 15:57:15


In addition to LaRetts.
I was also thinking of the possibility of having sometimes "(space)2" in the
field.
This can be solved by including TRIM in your calc:
If (TRIM(fieldwhatever)="2"; thenthis;elsethat)

good luck
Rienk



Quote:

> Hi Eric,

> If you list out your script it would help.  BTW, why aren't you just
> doing a find on '1'?  Wouldn't that be easier?  Just a thought!

> Also, are you in multi-user environment?  Omit can cause unexpected
> results in mutli - I've heard.   :)

> What are you using for the value list?  If it's checkboxes, maybe
> someone is entering both values.  Even with radio buttons, it's
> possible to click BOTH - I forgot the exact command to make that
> happen, but it's possible.

> Also, can someone change the value in your value list?  Do you have
> 'member of value list' and 'strict' clicked?  Maybe it's a (space) 2.
> Have you checked the data in the fields to be sure they contain only a
> 2?  What happens if you 'manually' find '2' and omit?

> LaRetta

> --
> Posted via http://dbforums.com

 
 
 

Testing value list

Post by Eri » Thu, 10 Jul 2003 05:57:52


hi,

I found my mistake and I just wanted to post it so it could help
someone else.

My script was kind of like this:
show all records
go to first record
loop
   if(field="2")
      omit record
   end if
   go to next record
end loop

but I should have done this:
show all records
go to first record
loop
   if(field="2")
      omit record
   else
      go to next record  
   end if
end loop

I didn't know before that ommiting a record make a "go to next" at the
same time but it's logical. So with my previous script I wasn't
testing a record as soon as I ommited one.

I hope this will help you!