I agree with aytee111.... get the expression working first. There shouldn't be a reason for the IIF() function (immediate If) to throw an error.
The IIf function has 3 parts: the condition, the value if true and the value if false.
1) The condition..
You are using "[CountOfLine ID]=Null". Since this looks like a numeric type field, I would use "NZ([CountOfLine ID],0) = 0"
2) The value if TRUE.
You have "This has not been invoiced against". I don't understand... is this is the full expression???? 
3) The value if FALSE
You have "Line numer " & [line number] & " has been invoiced against " & [countofline id] & " times. The remaining line quantity is " & [remaining quantity] & ". Which equates to £" & [remaining value] & "."
This is the original expression the you say works.
Putting it together:
function =IIF(
condition NZ([CountOfLine ID],0) = 0,
value if TRUE "This has not been invoiced against",
value if FALSE "Line numer " & [line number] & " has been invoiced against " & [countofline id] & " times. The remaining line quantity is " & [remaining quantity] & ". Which equates to £" & [remaining value] & "."
)
Code:
=IIf(NZ([CountOfLine ID],0) = 0,"This has not been invoiced against", "Line numer " & [line number] & " has been invoiced against " & [countofline id] & " times. The remaining line quantity is " & [remaining quantity] & ". Which equates to £" & [remaining value] & ".")
Maybe you are trying to concatenate the string "This has not been invoiced against" to the beginning of the original expression if the value of [CountOfLine ID] is zero.
That would be (I hope):
Code:
=IIf(NZ([CountOfLine ID],0) = 0,"This has not been invoiced against ", "") & "Line numer " & [line number] & " has been invoiced against " & [countofline id] & " times. The remaining line quantity is " & [remaining quantity] & ". Which equates to £" & [remaining value] & "."