Sorry to jump in but are you absolutely sure that the current table is the one you think it is - I know that selecting a grid will often change the current alias so when you come back to the Locate it may be doing it on the wrong table - just a thought.
I often do a explicit Select before a Locate just to make sure.
Caroline
>Hi Jim, I tried that too and it didn't work. I have a grid on the same page, when my user clicks on the grid selection, the data in fields below change. Can the grid be affecting the locating of the records? Deletes doesn't seem to work either, it won't refresh my grid with new data event though sendupdate is .t. I changed the thisform.f to a local variable:
>
>zx = a__gen12(1,1)
>LOCATE FOR lv_veh_assign.a_uniqueid = zx
>
>But that didn't work either.
>
>>Nick,
>>
>>Add the Thisform in the LOCATE. LOCATE does not work with WITH/ENDWITH
>>
>>
>>WITH thisform
>> hrecno = RECNO()
>> .visible = .f.
>> DO FORM add_assign WITH .a
>> .visible = .t.
>> lc_id = .a
>> REQUERY('lv_veh_assign')
>> lvassign = RECCOUNT('lv_veh_assign')
>> IF lvassign > 0
>> SELECT MAX(lv_veh_assign.a_uniqueid) FROM lv_veh_assign ;
>> WHERE lv_veh_assign.a_id = .a INTO array a__gen12
>> .f = a__gen12(1,1)
>>* Note Thisform added on the next line
>> LOCATE FOR lv_veh_assign.a_uniqueid = Thisform.f
>> RELEASE a__gen12
>> .f = lv_veh_assign.a_uniqueid
>> .pf1.p3.cmddelassign.visible = .t.
>> .pf1.p3.refresh()
>> ELSE
>> .pf1.p3.cmddelassign.visible = .f.
>> ENDIF
>>endwith
>>
Caroline