Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding records... or not.
Message
From
03/06/1997 10:25:47
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
 
 
To
03/06/1997 10:16:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00034710
Message ID:
00034713
Views:
36
>My abbreviated 'vcr' buttons class has but 2 buttons: 'Add' and 'Edit'. Upon clicking one of them, their captions change to 'Save' and 'Undo'. The basic functionality is as follows: Add--> append blank, refresh, controls readonly = .F.. Edit--> Controls readonly = .F. Save--> if any fields have been updated send changes to audit trail and tableupdate. Undo-->tablerevert.
>My question arises with the last little bit of functionality. If a user clicks 'Add' and then begins to add a new record, then changes her mind and clicks Undo, I would like for the newly appended record to be deleted. Seems simple enough; just check if the form is in add_mode or delete_mode, as set by the add or edit buttons, and then delete or tablerevert() accordingly. But the delete doesn't seem to be working. It gives me unique key violation errors (I don't assign a unique key until the user clicks save) first, and then asks if I want to revert. All's well in the end, but the road is pretty ugly. All of the minor difficulties involved has made me wonder if I am doing things the hard way. Is there something wrong with the way I am trying to do this? How do you handle similar situations? Do I need some basic restructuring? Does anyone have a graceful class that handles this that they are willing to donate? Any suggestions or related expertise is greatly appreciated.
>
>Erik Moore

firstly, if u are not assigning any unique value and error is coming... may be there is a blank record, already in the file. Pls chk.

there have been already lot of discussion on the same like generating a unique value, creating record navigation and add/edit buttons.

pls chk the previous discussions.
Previous
Reply
Map
View

Click here to load this message in the networking platform