>I have a simple procedure that is giving me a varible not found error. The variable fox can't find is a field in the currently selected table.
The first thing I looked for was not having the right table selected the 2nd time thru the loop...and I found it.
Just prior to entering the outer loop the first time, you have work area 1 selected. But in the last few lines of the outer loop, you select work area 2 so that the 2nd iteration of the loop begins in work area 2.
Granted, I cannot see why this breaks in the way you said it did (because you do set work area to 1 just prior to the offending SET FILTER command. However, having the loop start in work area 2 the second time thru is definitely bad for business.
When you get the "variable not found" error, the first two things to always look at are:
1. Did I spell it right?
2. Do I have the right table selected?
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum