Calculated form fields dissapear in queries/reports

G

Guest

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])
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top