Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox with Control Source Problem ??
Message
From
27/01/2005 23:13:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
27/01/2005 22:53:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows '98
Network:
SAMBA Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00981597
Message ID:
00981604
Views:
20
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform