>Thanks for your response, I can't understand why the failure so I have started putting in set order before seek just in case.
>
Just in case ???
Oh from your first message I assumed you were using it already. With WHILE it should be the case. A WHILE ends as soon as the criteria is false. So a set order is quite a need for sampe code like yours. You can't depend on physical entry order.
In any case if you think WHILE is a problem simply use FOR instead. A FOR automatically rewinds to top, yes, but fox is clever enough to use index to find records for replacement with expressions like in your sample (I don't mean WHILE is a problem - whenever I saw WHILE fail it was my fault not Fox's).
WHILE with ALL is likely to always fail. Suppose you have ids :
1...1000
lnID = 32
seek lnID
replace myField with 'dummy' WHILE IDField=m.lnID ALL && 0 replacement
If I remember correct in your original message m.id was char ? If so remember if set exact is off :
ID:A would match m.ID 'A','AA','AB','A...' etc Padr the id to fieldsize and use == (or exact on).
PS: You can use FOR and WHILE together in the same command.
Cetin