Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Calculated field in a form
Usman Nizamani 
   
5 years ago
I have been trying to calculate age using todays' date field from the same form while the date of birth comes from the parent form but access doesn't seem to like this and shows #Name? error. Is this the right approach or am I doing something wrong here?
Adam Schwanz  @Reply  
           
5 years ago
Sounds like it's not talking to the field.

Do you mean form/subform? If so you need to change the wording of the calculation a little to talk to the subform.
Forms!FormName!SubformName.Form!FieldName

Or do you mean another form entirely? Is this other form open when you open the form with the calculation?
Forms!FormName!FieldName

If it's not open, you'll have to get the value from the table, probably with a DLookup
Usman Nizamani OP  @Reply  
   
5 years ago
so i'm trying to fetch another field from another (parent, in one to many relations) table (and even form based on it) for creation of expression. Aren't they supposed to talk to each other when they are in relationship (in this case direct)?
Adam Schwanz  @Reply  
           
5 years ago
They are related but may not be being told to communicate how you want it to with your code. So if it's in another table with an established relationship, just use a DLookup

Set your text field control source to something similar to this, you'll have to change your field/tablenames into it

=DLOOKUP("DateOfBirthFieldName","ParentTableName","RelationIDField=" & RelationIDFieldOnForm)

That will provide you with the date of birth, and then you can calculate the age with it.
Scott Axton  @Reply  
        
5 years ago
This video may help you determine your issue.

Form notation  {https://599cd.com/blog/display-article.asp?ID=1647}
Adam Schwanz  @Reply  
           
5 years ago
Richard Rost  @Reply  
          
5 years ago
Are you actually using a form / subform combination, or are you trying to read a value from a table directly? If the latter, use DLOOKUP.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 8:53:36 AM. PLT: 1s