Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inputting Data from form

Status
Not open for further replies.
Dec 17, 2003
39
US
I have calculated the age in form from a birthdate field using

Int((Date()-[birthday])/365.25)

in my control source of the form. Can someone please tell me how i can get this information stored in the table? Right now, its just on the form and is dynamic I guess.
 
you can set the value of the control source by putting the following code within code.


something like name of contrl = birthdate.value

Let me know if you don't understand.

Currently seeking for position around Boston, MA. kenphu@yahoo.com
 
Hi,

You do not need to store calculated values in the database. In fact you should not store calculated values as a rule (except for maybe archiving old data). You have the correct setup already. You should have birthday as a field in the tables and use the calculated age values to display on forms or reports.

If you store calculated values in your database, it is no longer normalised and you can run into problems. For example, if someone were to change the value manually in the age field, you would have data that was inconsistent with the birthday field and it would be a right mess.

I suggest you leave it as it is. This way your data tables only contain raw data and not derived data.

Dean :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top