Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146

    Exclamation Unanswered: DateAdd Question

    I have a form that contains the following fields:

    EntryDate
    NumberWeeks
    ExpirationDate

    ExpirationDate is a calculated field with a control source of '=DateAdd("ww",[NumberWeeks],[EntryDate])'. Therefore, I enter a starting date and a number of weeks and Access calculates the expiration date based on that criteria.

    For example: If I enter starting date of 10/7/04 and 2 for my number of weeks, then Access outputs 10/21/04 in the expiration date field. 10/21/04 is obviously 2 weeks after 10/7/04..pretty simple.

    My problem lies in the fact that I can only see the starting and stopping date and not those in between. (In this case, 10/14/04) I want to be able to display each and every date between the starting and stopping dates on the same form, but have not been able to figure out how just yet. (In this example, I'd want to display 10/7/04, 10/14/04, and 10/21/04) Any ideas on how I can accomplish this task?

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Use a list Box

  3. #3
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    Quote Originally Posted by hammbakka
    Use a list Box
    I feel that this is a good idea when it comes to LISTING the individual dates, but I don't think it will help me in actually calculating those dates. I can get the starting and ending dates, but not those in the middle.

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    You have the starting date, and computed the end date
    Make a loop adding 7 days to the starting day untill you reach the ending date.
    Put this in a string separated with Semicolon, then use it a the RowSource of the ListBox, its type should be "Value List"

    Me.RowSourceType= "Value List"

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi smacdonaldnc,

    Somebody check me as I may be wrong, but since you have set it up to run dates by WEEK, it is giving you the Weeks, just as you are requesting it. Maybe, instead of WW, you can do the Days instead which should show you Days? I might be wrong, but someone check this out and verify.

    have a nice one,
    Bud

Posting Permissions

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