PC Review


Reply
Thread Tools Rate Thread

Age Field in Form but Not Query

 
 
antmorano@gmail.com
Guest
Posts: n/a
 
      24th May 2007
Hello All:

I am currently in the process of creating a database based on retiree
information. I inputted all of my data into one main table and then
created queries from this table. I then created a form based on each
query. I needed Access to calculate the age of retirees so I followed
the directions from Access which explain that a text box needs to be
created in the form and then a formula is inserted in the
ControlSource. This turned out fantastic and I got the results that I
wanted. I realized that one of the reports that I need to create is
based on people being below the age of 65. When I go to create a new
query, in hopes of setting a filter for <65, age is not there b/c it
is only in the form. Does anyone know of a way that the retiree age,
once calculated, can be inserted in the query? I'm assuming that a
macro would be needed. If more information is needed I would be glad
to provide it. Hope to get some new ideas. Thanks again.

-Anthony Morano
Pension Fund Intern

 
Reply With Quote
 
 
 
 
fredg
Guest
Posts: n/a
 
      24th May 2007
On 23 May 2007 20:01:11 -0700, (E-Mail Removed) wrote:

> Hello All:
>
> I am currently in the process of creating a database based on retiree
> information. I inputted all of my data into one main table and then
> created queries from this table. I then created a form based on each
> query. I needed Access to calculate the age of retirees so I followed
> the directions from Access which explain that a text box needs to be
> created in the form and then a formula is inserted in the
> ControlSource. This turned out fantastic and I got the results that I
> wanted. I realized that one of the reports that I need to create is
> based on people being below the age of 65. When I go to create a new
> query, in hopes of setting a filter for <65, age is not there b/c it
> is only in the form. Does anyone know of a way that the retiree age,
> once calculated, can be inserted in the query? I'm assuming that a
> macro would be needed. If more information is needed I would be glad
> to provide it. Hope to get some new ideas. Thanks again.
>
> -Anthony Morano
> Pension Fund Intern


Just calculate the age in the query, then use that column to filter
for ages under 65.

In a query, add a new column:
Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)

As criteria on this Age column, write:
<65
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
Tom Wickerath MDB
Guest
Posts: n/a
 
      24th May 2007
if you were using Access Data Projects then you shoudl use this column as a
calculated field-- then it's easy to manager and always accurate

using calculations like this in a query is short-sighted, because you can't
reuse that business logic





"fredg" <(E-Mail Removed)> wrote in message
news:yjdze085garm$.(E-Mail Removed)...
> On 23 May 2007 20:01:11 -0700, (E-Mail Removed) wrote:
>
>> Hello All:
>>
>> I am currently in the process of creating a database based on retiree
>> information. I inputted all of my data into one main table and then
>> created queries from this table. I then created a form based on each
>> query. I needed Access to calculate the age of retirees so I followed
>> the directions from Access which explain that a text box needs to be
>> created in the form and then a formula is inserted in the
>> ControlSource. This turned out fantastic and I got the results that I
>> wanted. I realized that one of the reports that I need to create is
>> based on people being below the age of 65. When I go to create a new
>> query, in hopes of setting a filter for <65, age is not there b/c it
>> is only in the form. Does anyone know of a way that the retiree age,
>> once calculated, can be inserted in the query? I'm assuming that a
>> macro would be needed. If more information is needed I would be glad
>> to provide it. Hope to get some new ideas. Thanks again.
>>
>> -Anthony Morano
>> Pension Fund Intern

>
> Just calculate the age in the query, then use that column to filter
> for ages under 65.
>
> In a query, add a new column:
> Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
> Format(Date(), "mmdd"), 1, 0)
>
> As criteria on this Age column, write:
> <65
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail


 
Reply With Quote
 
'69 Camaro
Guest
Posts: n/a
 
      24th May 2007
Everyone please note that Aaron Kem.pf is attempting to impersonate one of
our regular posters again. Tom would never post such a message.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.


"Tom Wickerath MDB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> if you were using Access Data Projects then you shoudl use this column as
> a calculated field-- then it's easy to manager and always accurate
>
> using calculations like this in a query is short-sighted, because you
> can't reuse that business logic
>
>
>
>
>
> "fredg" <(E-Mail Removed)> wrote in message
> news:yjdze085garm$.(E-Mail Removed)...
>> On 23 May 2007 20:01:11 -0700, (E-Mail Removed) wrote:
>>
>>> Hello All:
>>>
>>> I am currently in the process of creating a database based on retiree
>>> information. I inputted all of my data into one main table and then
>>> created queries from this table. I then created a form based on each
>>> query. I needed Access to calculate the age of retirees so I followed
>>> the directions from Access which explain that a text box needs to be
>>> created in the form and then a formula is inserted in the
>>> ControlSource. This turned out fantastic and I got the results that I
>>> wanted. I realized that one of the reports that I need to create is
>>> based on people being below the age of 65. When I go to create a new
>>> query, in hopes of setting a filter for <65, age is not there b/c it
>>> is only in the form. Does anyone know of a way that the retiree age,
>>> once calculated, can be inserted in the query? I'm assuming that a
>>> macro would be needed. If more information is needed I would be glad
>>> to provide it. Hope to get some new ideas. Thanks again.
>>>
>>> -Anthony Morano
>>> Pension Fund Intern

>>
>> Just calculate the age in the query, then use that column to filter
>> for ages under 65.
>>
>> In a query, add a new column:
>> Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
>> Format(Date(), "mmdd"), 1, 0)
>>
>> As criteria on this Age column, write:
>> <65
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validate between form text box and query field in a form? GoBrowns! Microsoft Access VBA Modules 1 25th Jun 2009 02:49 PM
How to load a field control source from a query or form field valu Marco Microsoft Access Reports 0 24th Mar 2008 12:29 PM
HowTo Use a form to query results back to another field in form. WildCHR Microsoft Access Queries 1 2nd Apr 2006 09:17 PM
How to pass a query field result to a form field =?Utf-8?B?VGRhd2c=?= Microsoft Access Queries 1 11th Nov 2005 05:56 AM
How do you add field list to form after form created from query? =?Utf-8?B?QnVubnk=?= Microsoft Access 2 23rd Oct 2004 08:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:51 AM.