Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    whitelexi is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    20

    Quote Originally Posted by ssanfu View Post
    Since the AGE can be calculated, calculate it in a query and bind a control to the query column. There you go - AGE is never wrong!!
    Please can you explain this bit in more detail...

  2. #17
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    A form or report RecordSource can be table or query or a query that joins tables/queries. A field constructed by expression in query can be the ControlSource of a textbox. As long as field is in the RecordSource it is available to the ControlSource property. Set ControlSource to a constructed field same way as to any field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    whitelexi is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    20
    Wow! The most weird thing just happened... with the query created and working, i copied the code:
    DateDiff("yyyy",[DateOfBirth],Date())-IIf(Format([DateOfBirth],"mmdd")>Format(Date(),"mmdd"),1,0)
    into the control source of the Age Field in the form and voila... It does exactly what i wanted.

    Now the Age field on my form updates as soon as a date of birth is entered into the DateOfBirth field!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access 2003 automatic field entry
    By RANCHLAW56 in forum Forms
    Replies: 6
    Last Post: 12-30-2010, 02:57 PM
  2. Automatic Price for Booking - Access 2007
    By doquan0 in forum Queries
    Replies: 1
    Last Post: 08-27-2010, 11:34 AM
  3. Automatic Calculation in table
    By musicalogist in forum Access
    Replies: 4
    Last Post: 04-22-2010, 11:52 AM
  4. Automatic Report Generation - Access VBA
    By initiator in forum Programming
    Replies: 2
    Last Post: 04-19-2010, 05:10 AM
  5. Query DateDiff calculation excluding weekends
    By Masterfinn in forum Queries
    Replies: 3
    Last Post: 04-01-2010, 09:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums