Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Return .t. not working
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
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