Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I abort a form from the Init method?
Message
De
29/01/2008 17:40:08
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01286760
Message ID:
01286959
Vues:
27
>In order for this form to work, it needs data from another table. The incoming parameter is a value that is used in an INDEXSEEK command to see if there is any data. If that returns false, I use MessageBox to report the problem, and then RETURN .F.
>
>But, the form comes up anyway.
>
>Here's the code at the beginning of my Init method

The dodefault() is probably some framework code which may set focus to some control - which implicitly .show()s the form, can't set focus to a control on a form which doesn't exist.
Try to just move the dodefault() to the bottom of this.

>
>PARAMETERS nProjectID
>LOCAL nGrpCount
>
>DODEFAULT(nProjectID)
>nResult = INDEXSEEK(nProjectID, .T., 'Projects', 'ProjectID')
>IF NOT nResult
>	ASSERT nResult MESSAGE 'Project not found in Projects table'
>	RETURN .F.
>ENDIF
>
>
>What am I doing wrong here.
>
>Again thanks for your help.
>
>Jim

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform