
Announcements
Hi all
I have a timesheets app, and the relevant section looks like this:
I've got a calculation that works out the number of hours for the total hours box into a variable called "CalcHours", but I only want to display it if either the top line is fully filled out, or the bottom line is fully filled out, or both lines are fully filled out. In the default property of the total hours box I have the code below, and the Onchange Property of all of the time entry boxes recalculates the CalcHours variable and resets the Total Hours box to default.
If(
(!IsBlank(TL1ASH)&&!IsBlank(TL1ASM)&&!IsBlank(TL1AFH)&&!IsBlank(TL1AFM)&&!IsBlank(TL1PSH)&&!IsBlank(TL1PSM)&&!IsBlank(TL1PFH)&&!IsBlank(TL1PFM)) ||
(IsBlank(TL1ASH)&&IsBlank(TL1ASM)&&IsBlank(TL1AFH)&&IsBlank(TL1AFM)&&!IsBlank(TL1PSH)&&!IsBlank(TL1PSM)&&!IsBlank(TL1PFH)&&!IsBlank(TL1PFM)) ||
(!IsBlank(TL1ASH)&&!IsBlank(TL1ASM)&&!IsBlank(TL1AFH)&&!IsBlank(TL1AFM)&&IsBlank(TL1PSH)&&IsBlank(TL1PSM)&&IsBlank(TL1PFH)&&IsBlank(TL1PFM))
,CalcHours,Blank())
However, as you can see from the screenshot it's not blanking out the default when a partial line is filled in...
TL1ASH, TL1ASM, TL1AFH, TL1AFM, TL1PSH, TL1PSM, TL1PFH, TL1PFM are the 8 time entry boxes.
What am I missing?
Never mind worked it out - instead of:
!IsBlank(TL1ASH)
Should be:
!IsBlank(TL1ASH.Text)