Calculated form fields dissapear in queries/reports

J

Jesse

Hi,

I have a field "age" in my form which gets automatically calculated
according to "birthdate". When I try to use the field "age" in queries or
reports, it comes out blank. Is there a way to show the age in
reports/queries?

Thanks!

Jesse
 
D

Dirk Goldgar

Jesse said:
Hi,

I have a field "age" in my form which gets automatically calculated
according to "birthdate". When I try to use the field "age" in
queries or reports, it comes out blank. Is there a way to show the
age in reports/queries?

Create a calculated field in the query that performs the same
calculation as on your form. For example, if your form has a text box
named "Age" with a controlsource of

=fncAge([BirthDate])

then create a a calculated field in your query like this:

Age: fncAge([BirthDate])
 
J

Jesse

Thanks... must I have "birthdate" as a field in the query?

Dirk Goldgar said:
Jesse said:
Hi,

I have a field "age" in my form which gets automatically calculated
according to "birthdate". When I try to use the field "age" in
queries or reports, it comes out blank. Is there a way to show the
age in reports/queries?

Create a calculated field in the query that performs the same
calculation as on your form. For example, if your form has a text box
named "Age" with a controlsource of

=fncAge([BirthDate])

then create a a calculated field in your query like this:

Age: fncAge([BirthDate])

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
D

Dirk Goldgar

Jesse said:
Thanks... must I have "birthdate" as a field in the query?

Dirk Goldgar said:
Jesse said:
Hi,

I have a field "age" in my form which gets automatically calculated
according to "birthdate". When I try to use the field "age" in
queries or reports, it comes out blank. Is there a way to show the
age in reports/queries?

Create a calculated field in the query that performs the same
calculation as on your form. For example, if your form has a text
box named "Age" with a controlsource of

=fncAge([BirthDate])

then create a a calculated field in your query like this:

Age: fncAge([BirthDate])

The birthdate field must be present in the table from which the query is
selecting data, but it doesn't have to be included in the fields
actually selected.
 
Top