Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2014
    Posts
    12

    How do I change a date based on another date that is entered?


    I am using Access 2007. I have a main table that has a field called "Date Returned". In the subtable, which is linked to the main table, I have a field "SSR Date" in which I want to calculate a date 7 days from the date of the "Date Returned" field.

    I went into the property sheet for the "SSR DATE" field in the subtable and tried to put in the default value of =[MAINTABLENAME]![Date Received]+7.

    It seems to be doing something but all I get in the field is "#NAME?"

    Not sure what I am doing wrong....

  2. #2
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    Not sure but you can try:

    =Forms![MAIN TABLE NAME]![Date Received] + 7

    But this is if you're doing this on forms. If you're on the actual tables, you're not allowed to have calculated fields that refer to something outside the table.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    If you are just starting with Access and database, I recommend you adopt a naming convention that doesn't have embedded spaces (or special characters) in field or object names. It will save you hours of syntax issues over time.
    For names use only alphanumerics and "_" (underscore).

    I don't use subtables, but my guess is that the subtable has no knowledge of Maintablename.

    It isn't clear to me how you are doing "another date that is entered". Hopefully you are entering data via a form and not directly into a table. You might want to research the DateAdd() function and use it to populate the SSRDate field (along with any validation code, probably in a BeforeUpdate event).

    Good luck with your project.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date Query: Annual Data Based off of Form Date
    By steveabni in forum Queries
    Replies: 4
    Last Post: 04-21-2014, 02:15 PM
  2. Replies: 1
    Last Post: 11-26-2013, 09:25 AM
  3. Replies: 1
    Last Post: 12-12-2011, 06:32 AM
  4. Replies: 4
    Last Post: 07-27-2011, 12:42 PM
  5. Replies: 3
    Last Post: 06-03-2011, 03:09 PM

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