You need to ALIAS your fields differently:
Age1:
DateDiff("yyyy",Lifetimetbl.Dob1,Date())+(Date()<DateSerial(Year
(Date()),Month(Lifetimetbl.Dob1),Day(Lifetimetbl.Dob1)))
(Date()),Month(Lifetimetbl.Dob1),Day(Lifetimetbl.Dob1)))
Age2: DateDiff("yyyy",Lifetimetbl.Dob2,Date())+(Date()<DateSerial(Year
(Date()),Month(Lifetimetbl.Dob2),Day(Lifetimetbl.Dob2)))
(Date()),Month(Lifetimetbl.Dob2),Day(Lifetimetbl.Dob2)))
Age3: DateDiff("yyyy",Lifetimetbl.Dob3,Date())+(Date()<DateSerial(Year
(Date()),Month(Lifetimetbl.Dob3),Day(Lifetimetbl.Dob3)))
(Date()),Month(Lifetimetbl.Dob3),Day(Lifetimetbl.Dob3)))
It
doesn't matter what you call them, but they need to be
unique.
Tom Oakes
Personal PC
Consultants, Inc.
[EMAIL PROTECTED]
503.230.0911 (O)
402.968.6946 (C)
734.264.0911
(F)
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Hassan
Sent: Friday, December 30, 2005 10:05 AM
To: [email protected]
Subject: [AccessDevelopers] Re: categorizing with age only in reports
<[EMAIL PROTECTED]> wrote:
>
> There are many ways to "skin a cat" in Access. One way would be to
define your criteria in vba when you open the report like so...
>
> DoCmd.OpenReport "MyReport", acViewPreview, , "Age BETWEEN 16AND
25"
Thanks Lonnie for replying,
after reading here for a loong time i finally figure it out how to
restrict the report with ages 16-25. I made a query with that string
Age: DateDiff("yyyy",Lifetimetbl.Dob1,Date())+(Date()<DateSerial(Year
(Date()),Month(Lifetimetbl.Dob1),Day(Lifetimetbl.Dob1)))
with a criteria >=16 And <=25 The string works fine with Dob1,But
when I try to add Dob2, Dob3 etc, it says
duplicate output alias age?
How do I fix that? I'm basically trying to run the query for child1
through child5.
any ideas??
oh and i was trying your vba command by making a module and saving
the command in that but i wasnt sure on how to call that module which
shuold be related to that report.
Please zip all files prior to uploading to Files section.
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
