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
Charlie Hancock