Connecting Tech Pros Worldwide Forums | Help | Site Map

Age Group

Member
 
Join Date: Apr 2009
Posts: 63
#1: Oct 7 '09
When the Microsoft Access start it should automatically pick up the system date and update members’ age groups correctly in the form . For example if a person’s date of birth was yesterday and they turned 45 years old then the system would update their agegroup from 40 to 45.

debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,509
#2: Oct 7 '09

re: Age Group


nothing happens automatically you need to code that.
Member
 
Join Date: Apr 2009
Posts: 63
#3: Oct 8 '09

re: Age Group


i know that but i dont know how to put code there i know the formula is If
age= age/5
if mod!=0 then age- module
but i dont know how to start the code in microsoft access form
i put three text box in my form
age, DOB , agegroup
any help well be great
Newbie
 
Join Date: Oct 2009
Location: Virginia
Posts: 5
#4: Oct 8 '09

re: Age Group


lolodede,
You could do this a couple of ways: either place the code to calculate the age group in an Event (On_Open for a continuous form displaying multiple records at once or On_Current if you are displaying one record at a time) to update the displayed value in "Age Group" or create a non-visible calculated field for each record (place the age calculation using System Date vs. DOB in it) and run the "Age Group" off of that using its value as your criteria.

~JennDub
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,730
#5: Oct 8 '09

re: Age Group


I'm going to move this to the Access forum as it's an Access question.

JennDub has explained how to do this - Use a calculation either in the underlying query or in the control on the form.

Let us know how you get on with this.
Member
 
Join Date: Apr 2009
Posts: 63
#6: Oct 9 '09

re: Age Group


thanks for help alot but i dint know how to get value of textbox (age) to use it into another textbox(agegroup) and i dont know how to start this code because im biginner in vba and microsoft access forms
thanks
FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#7: Oct 9 '09

re: Age Group


A similar thread .
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,730
#8: Oct 9 '09

re: Age Group


Quote:

Originally Posted by lolodede View Post

thanks for help alot but i dint know how to get value of textbox (age) to use it into another textbox(agegroup) and i dont know how to start this code because im biginner in vba and microsoft access forms
thanks

Well, why don't you start by telling us what you have so far. Try to be as precise as possible, and to include everything that is related to this issue. It's hard to help with details when we don't know names of things like tables and fields that are involved.

The less you miss out of what we need the fewer times we'll have to ask for it.
Member
 
Join Date: Apr 2009
Posts: 63
#9: Oct 10 '09

re: Age Group


thanks for help but i figure out i need to use vba and if statement and everything is working
thanks again
Reply