>for i = 1 to m.nToDo > SeekKey = eval(ToDo[m.i]) > if( empty(m.SeekKey) ) > loop > endif > IsOutputLine = TRUE > go top in TaxDriverOutput && this is the line I need > do case > case !m.Success > exit > > case !seek(m.SeekKey, 'TaxDriverOutput', 'Id') > assert FALSE > Success = FALSE > > case TaxDriverOutput.td_code <> m.SeekKey && this one fails without the GO TOP > assert FALSE > Success = FALSE >>As long as TaxDriverOutput.td_code is the index expression of "ID" and you have not switched set exact, m.SeekKey or the record pointer interrupt-like between the two cases it seems seek() is not to be trusted always in vfp9. The other possibilities (compound index ID for instance) I can momentarily think of you would surely have checked yourself, spelling inconsistencies like td_code shouldn't be "healed" by a go top. [sigh]
case !seek(m.SeekKey, 'TaxDriverOutput', 'Id') and !seek(m.SeekKey, 'TaxDriverOutput', 'Id') && case (2) assert FALSE Success = FALSE case (TaxDriverOutput.td_code <> m.SeekKey) and !seek(m.SeekKey, 'TaxDriverOutput', 'Id') && case (1) assert FALSE Success = FALSE case (TaxDriverOutput.td_code <> m.SeekKey) assert FALSE Success = FALSE