Results 1 to 5 of 5
  1. #1
    rmoore is offline Advanced Beginner
    Windows XP Access 2016
    Join Date
    Feb 2020
    Posts
    47

    Auto-fill with a date


    Trying to auto-fill payment dates based on start date and the number of payments. Field1 is the start date, Field2 is the days between payments, Field3 is the number of payments. i need Fields 4 thru Fields 15 to auto-fill with how many dates in Field3.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    It sounds to me as though your db is not properly normalized.
    i need Fields 4 thru Fields 15 to auto-fill....
    This allows for up to 11 entries but what if the requirement changes to something greater.
    I would recommend that you normalize your data.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    I'd agree with Bob on the normalization. To kinda answer your question and play with the logic some, you could maybeuse DateAdd function, something like:

    Field2 is length of days to add
    Field3 is total number of payments or total fields to populate

    vDate = StartDate
    y = 4

    For x = 1 to Field3
    Field(y) = DateAdd("d", Field2, vDate)
    y = y + 1
    vDate = DateAdd("d",Field2, vDate)
    next x

    Like Bob said though, if you had more payments then fields you would have an issue.

  4. #4
    rmoore is offline Advanced Beginner
    Windows XP Access 2016
    Join Date
    Feb 2020
    Posts
    47
    Thanks for the advice. Im not sure what you mean the DB is not normalized.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    I would recommend that you search this forum and/or Google and read up a little on the subject. Working with a Db that is not normalized is likely to cause you problems.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-10-2017, 03:10 PM
  2. Replies: 3
    Last Post: 08-21-2015, 08:14 AM
  3. Auto Fill with Date and Time
    By Access_Novice123 in forum Access
    Replies: 6
    Last Post: 02-19-2015, 12:04 PM
  4. Auto fill date into unbound text box
    By data808 in forum Programming
    Replies: 4
    Last Post: 02-26-2014, 09:21 PM
  5. Auto Fill a date in a field
    By SJJ in forum Access
    Replies: 1
    Last Post: 02-17-2014, 02:39 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