Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Holding the name of a control as a string?
Message
From
05/03/2002 16:01:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00628023
Message ID:
00628654
Views:
26
Chris,

How about putting the validation code in the queryUnload() of the form? From your treeView, you would do something like:
if oCurrentForm.queryUnload()
    oCurrentForm.release()
    * now you can launch the new form
endif
In the queryUnload():
if (changesHaveNotBeenSaved)
    * prompt the user, or whatever you want to do
    nodefault   && prevents form from closing
endif
This also prevents a user from using the close button (the 'X') on the form if the data validation does not pass.

One more thought...I think it is usually better to allow the users to have more than one form open at a time. They may be editing something on one form, and get interupted and need to look up something else on a another form.

>Yep that's the idea - they can flick about opening one form after another (when each form opens I store away it's name and when another form is launched I first programmatically close the previous form...) the idea is that in the lost focus I detect any changes made and trap the user on the form.
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform