Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return .t. not working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Return .t. not working
Divers
Thread ID:
00694947
Message ID:
00694947
Vues:
52
Hello Sergey,
Please help i have the below code in the button

this button has two codes one is the default class library code because it is a class and the second is the local.

when i click the button it does the 'Do Default' that means it goes to the class module code and runs there and checks for the duplicate record found or not. and then it comes to the local code.

My problem is when it says duplicate record found it is not compltetely coming of the code it is going and reading the local code even after i say Return .t. in the class module code.

**************below code is in the button class library**************

IF DuplicateExists
WAIT CLEAR
?? CHR(7)
=MESSAGEBOX("Duplicate Record Found")
THISFORM.container1.SETFOCUS
RETURN .t.
ELSE && WE ADD THE RECORD
WITH THISFORMSET.basicform1
SELECT (.masterTable)
.AddRecord
ENDWITH

endif
*********************end **********************


******************this is in the local mode******************

SELECT DocIndex
REPLACE project_no with thisform.container1.project_no.value
REPLACE workpkg_no WITH thisform.container1.workpkg_no.value
REPLACE Tofrm WITH thisform.container1.ToFrm.value
REPLACE Sequence WITH thisform.container1.Sequence.value
REPLACE Loc1 WITH gCompany

* concatenate the seq code with it's parts
REPLACE seq WITH thisform.container1.project_no.value+thisform.container1.workpkg_no.value+thisform.container1.ToFrm.value+TRANSFORM(thisform.container1.Sequence.value,"@L #####")
= tableupdate(.t.,.t.)
thisformset.basicform1.txtdocdate.setfocus
ThisFormSet.BasicForm1.txtLoc1.Refresh
thisform.refresh
*********************************

Thank you.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform