tnx i will definitely look into that and use your code as model. sounds great! k
>>gotta love this stuff :) thanks hilmar - fantastic. thanks for the explanation as well.
>
>You are welcome. - If you delve into SQL commands, and especially the SELECT command (help topic: SELECT - SQL), you will soon find that often, a single command will replace a complicated loop, or set of nested loops, in more traditional programming.
>
>>
>>
>>k
>>>>tnx hilmar - works very neatly - however if there are NO duplicates - how would i prevent the query report screen from appearing?
>>>
>>>
>>>select name, count(*) as count;
>>> from mydata;
>>> group by name;
>>> having count > 1;
>>> INTO CURSOR TEMPDUPLICATE
>>>if _tally > 0
>>> MessageBox("Alert: There are duplicates.")
>>> browse normal
>>>endif
>>>
>>>
>>>Explanation: If no destination is given in an SELECT - SQL command, a cursor is automatically created, and the result is shown in a BROWSE window. If the destination is anything else (for example, a cursor which you name explicitly), it won't be shown; to see the result, you have to explicitly give a BROWSE command, or some other command to show the data.