>HI All...........
>I Have table Customer with field id, name
>
>Field Id --> Primary Key
>
>*****
>Textbox1, controlsource=id
>Textbox2, controlsource=name
>
># When I Click in command button Add :
> Select 0
> append blank
>
># When I Save data with The same id An Error Occurs *** unique of index violation ***
> Select 0
> TableUpdate(.T.)
>
># I Want to Ask
>1. How to Check if a user typing with the same id, How to display existing data??? or How to Handle it
You could do a seek(), to see if the value already exists. However, going away from the current record will try to save, if you use record buffering - better use table buffering. You can also USE ... AGAIN, and search in the second copy of the table.
>2. How to manage Error Handler *** unique index violated ***
See point 1. Just check for the error condition before Visual FoxPro does.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)