Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Buffer uncommited changes
Message
 
To
29/10/1998 10:51:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00152319
Message ID:
00152678
Views:
23
>Richard ---
>
>I think you have to put some code *before* requery that checks for changed/new records and asks the user if they want to discard or save the changes. You can do this by setting a From.Property (whatever you want to call it) True via the InterActive change event of the controls in the Grid. Before requery, ehck for that True and prompt the user (Save/Discard)....then reset the property to false....of course, this is generic advice.
>
>Uncommitted changes cause all sorts of problems.....

You could spin through all the fields in the table and look for a difference between CURVAL() and OLDVAL()

SELECT xxx
tchanged = .F.
FOR t = 1 TO FIELDS()
IF CURVAL(FIELD(m.t)) # OLDVAL(FIELD(m.t))
tchanged = .T.
EXIT
ENDIF
ENDFOR
answer = MESSAGEBOX("You have unposted changes. Post?" , 4+32+256, "Post changes?")
IF m.answer = 6
TABLEUPATE(.T., .T.)
ELSE
TABLEREVERT(.T.)
ENDIF
Ken Sorce
Team RAD, Inc.
Rapid Application Developers
Ken@TeamRAD.com
www.teamrad.com
Previous
Reply
Map
View

Click here to load this message in the networking platform