spartansFC
Programmer
Hi
I'm trying to show the Age of a child in a continuous subform but the subform is only duplicating the first value and repeating that no matter
how many children are in the list or how many different dates of birth there are.
the way i've worked out the Age is, on the main form i have:
Months_txtbox
Years_txtbox
date
on the subform i have:
Childage_txtbox
I've attached a screen shot to show what happens, as you can see the age "3.1" is shown for
both children, but i've highlighted the 2nd child "jordan" who's age is shown correctly on the main form.
I just need to tell the continuos form to look at the childID somehow
or tell the database to loop through the different DOB to show the correct age for each child.
Any ideas?
Mikie
I'm trying to show the Age of a child in a continuous subform but the subform is only duplicating the first value and repeating that no matter
how many children are in the list or how many different dates of birth there are.
the way i've worked out the Age is, on the main form i have:
Months_txtbox
Code:
=DateDiff("m",frmChildFormSubNames.Form!dteParentChildDOB,[today])+Int(Format([today],"dd")<Format(frmChildFormSubNames.Form!dteParentChildDOB,"dd"))-([Year_txtbox]*12)
Years_txtbox
Code:
=DateDiff("yyyy",frmChildFormSubNames.Form!dteParentChildDOB,Date())
-IIf(Format(frmChildFormSubNames.Form!dteParentChildDOB,"mmdd")>Format(Date(),"mmdd"),1,0
date
Code:
=today()
on the subform i have:
Childage_txtbox
Code:
=Forms!frmChildForm!Year_txtbox & "." & Forms!frmChildForm!Months_txtbox
I've attached a screen shot to show what happens, as you can see the age "3.1" is shown for
both children, but i've highlighted the 2nd child "jordan" who's age is shown correctly on the main form.
I just need to tell the continuos form to look at the childID somehow
or tell the database to loop through the different DOB to show the correct age for each child.
Any ideas?
Mikie