Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009

    Unanswered: Add Days to a Date in an Access Form


    I need help on a formula in an Access (2010) form. I have the formula below in an Excel spreadsheet and it works great, but how can I get the same function to work in an Access form?

    A B
    1 WO1 WO2
    2 3/1/2013 =+A2+7
    3 3/1/2013 3/8/2013

    What I am doing in Excel is adding days to dates. So, I will start out in Column A (Row 2) with 3/1/13 and in Column B (Row 2) I have a formula adding 7 days to the 3/1/13 date.

    I would like to do this in Access. I think I use the function =DateAdd, but I can’t get it to work and I don’t know where to place the formula.
    If someone can help me I would really appreciate it.

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    Have a look in Access help to the DateAdd() function. Information about it can also be found at: MS Access: DateAdd Function
    Have a nice day!

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    The first thing you need to understand is that in Relational Databases it is seldom appropriate to store Calculated Fields (which is what you're creating here) in a Table; instead, you simply re-calculate the value as needed, in other Forms, Reports, etc.

    Because of this, in your Form, you can place your expression for the calculation in the target Control's Control Source.

    In Form Design View

    • Select the Textbox you want to use to display the calculated date
    • Go to Properties - Data
    • In the Control Source box enter
    • = DateAdd("d",7,[OriginalDateFieldName])

    You'll need to replace [OriginalDateFieldName] with your actual name, of course.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts