Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2005, 06:06 PM
Authorized User
 
Join Date: Feb 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default ME AGAIN!!!

Dartcoach/anyone, this is my problem and it is leading to me probably having to launch the laptop out of the first floor window... I have a table named members, two of the fields are DATE OF BIRTH and AGE. with everyones help i have managed to automatically show the age once the DOB has been entered(into the Members FORM). The problem is that the result(the AGE) is not showing in the table, the AGE on the table is showing blank but all the other members details are showing. This also means that i cannot create an enquiry involving age, becuase it is not registering the number in the table. HELP!!!

 
Old February 23rd, 2005, 06:15 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Satts,
Remember, you don't want to store the age! It is a field that should be recalculated everytime you need it, because it may have changed since the last time.

You can create a query, because the same calculation you use in your form, can be used in a query.

dartcoach


 
Old February 23rd, 2005, 06:35 PM
Authorized User
 
Join Date: Feb 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry mate. Ive got you now!!!! Where abouts on the Querie do I input the expression? How do i get the Querie to look at the Forms Age? I appologise if i am sounding a right thickie!

 
Old February 23rd, 2005, 06:41 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Satts,
I'm working on it.

Give me an hour or so.

dartcoach


 
Old February 23rd, 2005, 06:51 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Satts,

Paste this as a column on your query:

Expr1: DateDiff("yyyy",[BirthDate],Date())+CInt(DateSerial(Year(Date()),Month([BirthDate]),Day([BirthDate]))>Date())

Use the criteria to get only the ages you want.

You can thank the individual on your previous post for the code, I just tested it.

dartcoach

 
Old February 23rd, 2005, 06:56 PM
Authorized User
 
Join Date: Feb 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mate, is this going to allow me to look for eg. members under the age of 18???

 
Old February 23rd, 2005, 07:01 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes. In the criteria section under the above code, put < 18

it will give you everyone on your table who's age is less than 18

dartcoach

 
Old February 23rd, 2005, 07:05 PM
Authorized User
 
Join Date: Feb 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have pasted that expression in the query column and it asks me to enter parameter value??????????????? This is doing my head in!!! Do you reckon i will get the hang of this!!!???

 
Old February 23rd, 2005, 07:06 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

which value is it asking for?


 
Old February 23rd, 2005, 07:07 PM
Authorized User
 
Join Date: Feb 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dartcoach, you have done it mate. This time it really has worked!!!!!!!!!! cheers mate.










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.