I have an unbound text box in a subform with the following IIf statement:
=IIf([Day]=1,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day1,IIf([Day]=2,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day2,IIf([Day]=3,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day3,IIf([Day]=4,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day4,IIf([Day]=5,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day5,IIf([Day]=6,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day6,IIf([Day]=7,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day7,0)))))))
The problem is when the record in Forms![Master Schedule]!SchHCWeekHrsSbfrm is Null because there is no record for this client. I get the proverbial #Error returned in my text box. I've got 4 more boxes with similar expressions and at least one of them will have a record to record. Can you help with a way around this where I can get a 0 returned when this occurs? Thanks for any help. You folks are wonderful.
=IIf([Day]=1,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day1,IIf([Day]=2,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day2,IIf([Day]=3,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day3,IIf([Day]=4,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day4,IIf([Day]=5,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day5,IIf([Day]=6,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day6,IIf([Day]=7,Forms![Master Schedule]!SchHCWeekHrsSbfrm.Form!Day7,0)))))))
The problem is when the record in Forms![Master Schedule]!SchHCWeekHrsSbfrm is Null because there is no record for this client. I get the proverbial #Error returned in my text box. I've got 4 more boxes with similar expressions and at least one of them will have a record to record. Can you help with a way around this where I can get a 0 returned when this occurs? Thanks for any help. You folks are wonderful.