Getting data from a parent form

Galphanore

Registered User.
Local time
Today, 00:08
Joined
Apr 5, 2006
Messages
23
I have been having alot of trouble with this and just can't figure it out, I am trying to get data from a parent form into a subform so I can use it in equations. Specifically I have a DOB (Date of Birth) field on the main form, and want to have a =DateDiff("yyyy",[DOB],Date()) to find their age.

I need this in the subform because of some other information that relys on it. The way I have it right now you have to manualy put the DOB in the subform, and it can be different from the value in the main form. Could any of you tell me what I am doing wrong here?
 

Attachments

=DateDiff("yyyy",forms!MyMainFormName![DOB],Date()) to find their age.

???
 
Thanks! That works, but how do I get it to update the age if I change the DOB? Right now the database has to be closed and reopened for the change to take effect.
 
In the after update of the control DOB on your form Contact put this;

Code:
Me.[COLOR="Blue"]subform[/COLOR].Requery

Replace subform with the Name of the Subform control on your main form.
 

Users who are viewing this thread

Back
Top Bottom