A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Calculating age in a form



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old July 14th, 2009, 07:01 PM posted to microsoft.public.access.forms
tm3025
external usenet poster
 
Posts: 11
Default Calculating age in a form

I entered the following expression into the control source of an unbound text
box on a form. The form was created from a personal info table which DOB came
from, but Date of X came from a different table. When I try to enter this it,
all I get in the text box is #NAME?

=DateDiff("yyyy", [DOB], Surgery![Date of
X])-IIF(Format([DOB],"mmdd")Format([X!Date of X],"mmdd"),1,0)

My first attempt at this involved a query with the same expression, and it
returned correct values. However, when I made the field from the query the
control source of the text box in the form, it also returned #NAME?

I'm guessing there must be something wrong in the way I am going about this.
Any help would be much appreciated.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.