Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Clear Windows vs ThisForm.Unload vs ThisForm.Release
In my current app, all forms are permanently maximized inside the VFP main screen. With the exception of popup screens, there should only be one form active at a time. As users move from screen to screen (via buttons) I used to have the following code.
> CLOSE DATABASES blah blah blach
> CLEAR WINDOWS
> DO FORM blah.scx
I was in contact with MS Tech support regarding an unrelated issue and sent them my code. They suggested I not CLEAR WINDOWS but instead use THISFORM.UNLOAD.
I changed my code over and now I have an intermittant error (which may be unrelated): CAN NOT ACCESS THE SELECTED TABLE pops up 7 times on my main form... sometimes. In fact the main form does not have even one table or database open. I can not detect the pattern that causes the error. What is realy odd is that my error routine is not catching the error. I have checked the KB and found a number of bugs and probs which can cause this prob (other than the obvious one of having an inaccessable table) but none of the items applied to my code.
Anyway... I think it may be related to this THISFORM.UNLOAD change. I have read the MSDN help on the three code but I am still unclear on the differences. So my questions are:
1: Any other ideas on the the CAN NOT ACCESS prob, and/or;
2: What do you code do you use when a form is closed and why.
Thanx in advance.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement