Just read my message and it makes me sound a bit Head Teacher like. It wasn’t meant to come over like that, apologies if it did.
Jon
>Hey, that's fine, John. This is the 1st I've seen of this thread. I had no idea where/how he was electing to do the search on the other grid, and "don't cared". The code I outlined should still work regardless IMO.
>
>>As I've already pointed out to M he needs to look a the design of the form before coding it. Currently the code below runs in the afterrowcolchange of a grid, this is not the best way to allow selection from a grid.
>>
>>I suggested adding a checkbox to the grid which will wllow the user to be sure what they are selecting.
>>
>>I dont know why I'm telling you this as I know you already know this kind of stuff.
>>
>>
>>>M
>>>
>>>Assuming the table (MyTable) in your source grid is current, i.e. the selected table, then you can say:
>>>
>>>
>>>LPARAMETERS nColIndex
>>>
>>>lcType = MyTable.TypeField
>>>Select Temp
>>>LOCATE FOR TYP = lcType
>>>IF !FOUND()
>>> APPEN BLANK
>>> REPLACE TYP WITH lcType in TEMP
>>> GO top
>>> thisform.grid1.refresh
>>>ELSE
>>> =MESSAGEBOX("found.....")
>>>endif
>>>
>>>
>>>Terry
>>>
>>>
>>>>hi all,
>>>>
>>>>i need help to insert item (evrey time one item only) from grid2 to grid1
>>>>i try via this code under.
>>>>but this code get all items form grid2 and replacement to grid1
>>>>
>>>>but i need to replace one item after i make choice
>>>>i try ==,
>>>>i try set exact on,
>>>>and set near off,
>>>>and upper,alltrim
>>>>same result ...
>>>>
>>>>
>>>>LPARAMETERS nColIndex
>>>>LOCATE FOR temp.typ=THISFORM.GRID2.column1.text1.VALUE
>>>>IF !FOUND()
>>>> SELECT 3
>>>> APPEN BLANK
>>>> REPLACE temp.typ WITH THISFORM.GRID2.column1.text1.VALUE
>>>> GO top
>>>> thisform.grid1.refresh
>>>>
>>>>ELSE
>>>> =MESSAGEBOX("found.....")
>>>>endif
>>>>
>>>>
>>>>thanks.