Re: Calculate age on a specific date

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



To debug the function, open the Immediate Window (Ctrl+G) and enter something like:
? Age(#1/1/1980#, #7/23/2008#)

Once you have that working, verify that your DateOfBirth field is actually a date/time field (not text.)

Then add a breakpoint to your code, and test what's going on.

The function does work.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Bagheera" <Bagheera@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EB3EC583-5572-403F-85D1-AE942565D764@xxxxxxxxxxxxxxxx
Thanks for your patience. Sadly, I still can't get this to work for me. I
replaced the " with # as instructed with the same error. I created a new
control with the calculation but get #Error in the field. Incidentally,
despite typing in the date in the formula in US format, it converts it to the
UK format.

With more than 1,000 records expected, it would have been nice to have been
able to get the age to calculate automatically - it's pretty much the crux of
a whole lot of other things for the database and crops up repeatedly but you
can't have everything.

.



Relevant Pages

  • Re: Date programming question.
    ... Firstly, any date/time field is stored within Access as a number, where the ... The Format merely affects how the date is displayed, ... if the text box in the Form Header is bound to a date/time field ... the form, you might use unbound boxes (Control Source property is blank, ...
    (microsoft.public.access.modulesdaovba)
  • Re: problems with disks
    ... Julian Thomas wrote: ... > Last night i ran the verify from the 'format' command an got many errors. ... > can i still use thus disk without risk? ...
    (comp.unix.solaris)
  • Re: Is it possible to Change String Delimiter without using an int
    ... If the format of your date/time field is always as shown, ... Dim avarSplit As Variant ... >>> Hi Andi, ...
    (microsoft.public.access.externaldata)
  • Re: Unable to reformat hard disc on RPC
    ... it fails to format the disc. ... not using the verify in!HForm, just verify the drive from the desktop. ...
    (comp.sys.acorn.hardware)
  • Re: Passing form data to a query thru a macro
    ... the DD information is kept as well. ... > how to make this text entry field into a date/time field that matches the ... >> Jeff Boyce ...
    (microsoft.public.access.queries)