General information
Category:
Coding, syntax & commands
>Hi,
>
>I'm having trouble with my custom write buffer.When I am on a record and make changes then go to the next record using my toolbar the writebuffer traps for changes and allows me to commit or revert my changes. But if I were to make changes then select my listbox and go to another record, the changes are already committed. How do I check if data has changed in any of my text boxes and prompt the user to save, discard or cancel the last action?
>
>TIA
>Jon
Jon, I've read some of the other responses, and I have experienced some of the same frustration. Remember that in row buffering, changes are committed when 1) you issue a tableupdate, or 2) when you move the record pointer. I decided on table buffering, because it does not update when the record pointer is moved. the following is a portion of code that I use to determine if changes have been made. the -1 argument returns a string that coresponds to the length of the record. A "2" will be in the string is an existing record, and a "4" will be in the string for an appended record. those characters will be in a postion that coresponds to the postion of the field that has changed. Thus, if a "2" or "4" is contained in ($) the string, then the record has been modified. This code is part of a larger section that does some other things, so that is why there is more there than necessary.
IF "2" $ GETFLDSTATE(-1) OR "4" $ GETFLDSTATE(-1)
lsuccess=TABLEUPDATE(.T.) && Commits changes
IF lsuccess
lsaved = .T.
ENDIF
ENDIF
HTH....Bill
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only