Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TableRevert() not working after form loses focus
Message
 
 
To
11/10/2001 14:20:11
Charlie Hancock
California Dept of Public Health
Richmond, California, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00567147
Message ID:
00567153
Views:
14
This message has been marked as the solution to the initial question of the thread.
>For my customer database, I have two forms displayed at once: one for data entry, and the other to display possible duplicate records as data is being entered. Both forms have DataSession = 2 (Private data session). Both forms have the same customer table in their Data Environment. Both forms have object reference properties to each other.
>
>In the data entry screen, to add a new record to the customer table I use:
>
> CURSORSETPROP("Buffering", 2) && pessimistic row buffering
> APPEND BLANK
>
>When the operater reaches certain data entry fields (for instance, a LastName textbox), the Valid() code for that control calls a method in the duplicate display form, which SEEKs and displays matching values in the customer table.
>
>The problem occurs when the operator notices a duplicate record displayed (a pre-existing record matching the one being entered). I have a "Cancel" button method in the data entry form that includes a TABLEREVERT() statement, which should remove the newly appended record.
>
>It works as intended, as long as I don't move focus from the data entry form. But if I move focus to the duplicate display form (for instance, to scroll through a grid of possible duplicate records), then move focus back to the data entry form to "Cancel" the new record, TABLEREVERT() has no effect--the customer table has already been updated to include the new record.
>
>Can anyone suggest a solution to this?
>
>Thanks in advance!
>
>Charlie Hancock
>Oakland, California USA

You may have code in the Activate event that synchronizes (or not). IAC, the record pointer is being "moved" and because yo have row-level buffering, an implicit tableupdate() is being performed. Change to Pessimistic Table buffering (4). That way, you will still get the behavior of the record being lcoked when edited, but you wil lbe able to control when the actual data gets written to disk via a tableupdate().

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform