Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie Form Buttons
Message
 
 
To
02/11/1999 17:28:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00285790
Message ID:
00285796
Views:
21
>What's the easiest way to put a "save to database" button and a "cancel" button on a form?
>
>JD

All my data is saved implicitly. That is no change is ever canceled unless the user explicitly clicks my Cancel button. My Exit button class has 1 line of code: ThisForm.QueryUnload(). My Cancel button has 2 lines of code:

ThisForm.lCanceled = .t.
ThisForm.QueryUnload()

By default, my form baseclass property, lCanceled, is set to False. In my form's QueryUnload method, I test the form's lCanceled property. If true, I call the form's RevertTables method. If not canceled, I call the form's UpdateTables method.

On my data entry form, all I have to do is drop my Cancel and Exit button on the form.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform