IF m.storeid=ALLTRIM(thisform.text1.Value) GATHER memvar for storeid=m.storeid && error . . . <snip> ELSEare you trying to do this?
IF m.storeid=ALLTRIM(thisform.text1.Value) REPLACE field1 with m.field1, field2 with m.field2 for storeid=m.storeid . . . <snip> ELSEThe REPLACE command can use a SCOPE clause where GATHER cannot.