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  

Date Calculation from two forms



 
 
Thread Tools Display Modes
  #1  
Old September 22nd, 2006, 10:24 PM posted to microsoft.public.access.forms
msgulf
external usenet poster
 
Posts: 4
Default Date Calculation from two forms

I have the date of birth on one form and the referral date on another. On
the form with the referral date, I want to calculate age at time of referral.
Here's the expression I've tried in various places (in a SetValue macro,
unbound control).


DateDiff("yyyy",Forms![frmReferrals_Main]![DateofBirth],Forms![frmReferrals_Source]![ReferralDate])+Int(Format(Forms![frmlReferrals_Source]![ReferralDate],"mmdd")Format(Forms![frmReferrals_Main]![DateofBirth],"mmdd"))

Am I missing something or can this not be done?
  #2  
Old September 22nd, 2006, 10:54 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Date Calculation from two forms

Access forms display data, Access tables store data.

Is there a way you can pull the underlying data together into a query and do
the calculation there?

If you are using the expression you posted, what results are you getting?
Syntax error messages? Incorrect calculations? ???

Regards

Jeff Boyce
Microsoft Office/Access MVP


"msgulf" wrote in message
...
I have the date of birth on one form and the referral date on another. On
the form with the referral date, I want to calculate age at time of
referral.
Here's the expression I've tried in various places (in a SetValue macro,
unbound control).


DateDiff("yyyy",Forms![frmReferrals_Main]![DateofBirth],Forms![frmReferrals_Source]![ReferralDate])+Int(Format(Forms![frmlReferrals_Source]![ReferralDate],"mmdd")Format(Forms![frmReferrals_Main]![DateofBirth],"mmdd"))

Am I missing something or can this not be done?



 




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 04:34 PM.


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