This is what I have now
IIf (IsNull(Forms![frmdischarge]![DDate])), DateDiff("d", [ADate], Date), DateDiff("d", [ADate], Forms![frmdischarge]![DDate])
but I keep getting errors can't find forms 'frmdischarge'. there is a frmdischarge and I've checked spelling several times. Any suggestion?