View Full Version : Calculated control - how can I make it work?


diplomat
04-27-2000, 04:48 PM
I created a query to calculate the age of my customers. I ran the query and it worked. I want to add to my data entry form a textbox with an expression based on that query to get the age calculated and displayed when the date of birth is entered. I added the expression using the epression builder and pointed to the query and then to the desired field (Age). However, it didn't work (#Name?)
Any help is appreciated!

Thanks!!!

Deb in LA
04-28-2000, 10:38 AM
I'm not sure if this is what you want, but if I'm understanding you right, you want a user to type in a date then your query runs based on that date and returns the age.

Have you tried to create 2 unbound fields on your form for the user to input a date the other does the calc? You do not need to create a saved query.

I jus did this example:

Unbound text field 1 properties:
Name: InputDate
Control: ---leave blank---
Format: Short Date

Unbound text field 2 properties:
Name: AgeCalc
Control:=(Year(Now()))-(Year([Forms]![YourFormName]![inputdate]))


Try this to see it it works on a new form that is not based on a query. Input a date (like your birthdate) in the first box. The age should calc and put the result in the 2nd text box.

Hope this helped.

Deb