Hello, I look for an information concerning a control of validity on a checkbox (on form). Indeed,
OnDeactivateForm()
IF ("Budget saisi"<>TRUE) AND
("Planning de facturation"<>TRUE) AND
("Plan généré"<>TRUE) THEN
BEGIN
ERROR('Le projet n° %1 n''a pas de budget saisi ou planning de facturation ou de plan généré',"N°");
CurrForm.UPDATE(FALSE); //I use this syntax, but that does not work
END;
I make the test above and I shall wish that the focus returns on one of the checkbox tested. Could you indicate me the solution, thank you.
0
Comments
Hope this is of some use to you.
Rick
[This message has been edited by goofyfish (edited 18-07-2001).]
The statement:
IF ("Budget saisi"<>TRUE) THEN
can be replaced by
If Not "Budget saisi"
as the variable "Budget saisi" by itselfes is already a boolean variable containing a TRUE or FALSE.
Therefore:
("Budget saisi"<>TRUE)
is equal to
("Budget saisi"=FALSE)
or
(NOT "Budget saisi")
According to the tautologies of De Morgan you can therefore replace:
IF ("Budget saisi"<>TRUE) AND
("Planning de facturation"<>TRUE) AND
("Plan généré"<>TRUE) THEN
with
if Not (
("budget saisi" or "Planning de facturation" or "Plan généré")
) then
If you issue an ERROR, all following statements will never be executed as the ERROR breaks all further processing.
Therefore you might replace the ERROR with a MESSAGE in order to continue the processing. Thus:
IF NOT (
("budget saisi" or "Planning de facturation" or "Plan généré")
) then Begin
MESSAGE('Le projet n° %1 n''a pas de budget saisi ou planning de facturation ou de plan généré',"N°");
CurrForm.UPDATE(FALSE);
END;
With best regards from Switzerland
Marcus Fabian
Marcus Fabian