View Full Version : Date Add Function


RACHNA
01-04-2000, 07:33 AM
I'm trying to calculate a date field on a subform based on a date field on the parent form using the following expression in the control source of the subform's date field i'm trying to calculate:

( I want the field to be 10 days from the Admission Date)

=DateAdd("d",10,[Forms]![frmAdmissions]![AdmissionDate])

I keep getting this error #Name?. Any ideas?

eason
01-04-2000, 07:17 PM
Try this in your control sorce:

=([Form]![form Admission]![Admission Date])+10

If it does not work let me know I may have another idea.


[This message has been edited by eason (edited 01-04-2000).]

Travis
01-04-2000, 08:18 PM
Check to make sure that you are referencing the correct Field Name (e.g., Miss Spelling)

Also I recommend have this field use and AfterUpdate of the Date Field.

Also add change your code just slighly:

Use Me instead of [Forms].[frmAdmissions]
This will reduce chances of error and typing.

RACHNA
01-05-2000, 07:48 AM
I've tried both of the suggestions above and i'm still not successful.

-still got #Name? (Eason)
-nothing happened (Travis)

Any other ideas?

Thanks much!

Travis
01-05-2000, 10:54 PM
Are you sure that the field you are referencing is the field name? That is the only time I know of that the #Name? error should occur.

RACHNA
01-06-2000, 10:04 AM
For some reason, the field was not recognized on the subform in my calculation. Spelling was correct.

I've added the date fields from the subform to the main form and it works fine.

I appreciate the help!