Originally Posted by
rwcozens
I will try using the iif function and post my results.
Secondly the syntax for the iif() function in the formaula you provided does not work. Could you please complete the syntax for me in other words the entire code to use in the control source of theage text box
Just check if below gives some guidelines :
Code:
=IIf(IsNull([Forms]![Form1]![PolicyID]),0,DateDiff("yyyy",DateSerial(Left([Forms]![Form1]![PolicyID],2),Mid([Forms]![Form1]![PolicyID],3,2),Mid([Forms]![Form1]![PolicyID],5,2)),Now())+Int(Format(Now(),"mmdd")<Format(DateSerial(Left([Forms]![Form1]![PolicyID],2),Mid([Forms]![Form1]![PolicyID],3,2),Mid([Forms]![Form1]![PolicyID],5,2)),"mmdd")))
Edit : Later on, You might have to add a validation rule based on your PolicyID format to the PolicyID text box in the Form, to alert the user, if it is wrongly entered.
Originally Posted by
rwcozens
I need to use the reslut of the theage field in other reports so surely then the result must be written to the table or how else can I use it in other reports.
1) Age is a Calculated figure & unless unavoidable, Calculated values should not be stored in tables.
2) You can use Queries as the source for Reports & in turn, you can use the query to calculate the Age & present it in the Report. The Calculation will follow along the same lines as we have done in the Form with appropriate replacement of Form values.
Thanks