Conditional textbox

BarryMK

4 strings are enough
Local time
Today, 09:47
Joined
Oct 15, 2002
Messages
1,350
Is it possible to display a textbox if a condition is met. For example if a date diff is less than two days then display a text box in each record meeting this criterion with the text "Fail" and one showing "Pass" if greater than 2 days?

Reportsmith allows this function using a macro suchas the one below:
Sub respby()
JStartDate = datefield("AStartDate",1)
JTargetDate = datefield("ATargetDate",1)

If JStartDate < 0 then
Result = " NoActs"
else
Result = "Pass"
End if

if JStartDate > JTargetDate then
Result = "FAIL"
end if
Derivedfield Result
End Sub
 
Last edited:
Would this work?
Code:
Reportsmith allows this function using a macro suchas the one below:
Sub respby()
JStartDate = datefield("AStartDate",1)
JTargetDate = datefield("ATargetDate",1)

If JStartDate < 0 then
Result = " NoActs"
else
Result = "Pass"
End if

if JStartDate > JTargetDate then
Result = "FAIL" 
end if
 
If Result = "Pass" or Result = "FAIL" Then
       [I]name of textbox[/I].visible = True
else
      [I]name of textbox[/I].visible = False
end if
Derivedfield Result
End Sub
 
Thanks I'll take a look tomorrow.
 
I got this from Crystal's forum and it works. Thanks for the suggestion though. Create a new derived field with this code

if DateDiff ("d", {NVActns.StartDate}, {NVAPR.FirstRespTgt}) < 2 then "Fail" else "Pass"
 

Users who are viewing this thread

Back
Top Bottom