Results 1 to 3 of 3
  1. #1
    ducthang88 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    12

    Looping in Access

    This is my scenario:



    dateborrowed(text)
    =date()

    duedate(text)
    =[date()]+3

    fine/penalty IS MY PROBLEM
    --> i want this like for everyday after duedate a 5$ penalty for each succeeding day with a penalty cap of 30$ somthing like that.. (textbox updates everytime)

    example

    dateborrowed - Aug 1 1990
    duedate - Aug 4 1990
    fine = 5$ (august 5)
    =10$ (august 6)
    =15$ (aug 7)
    =20$ (aug 8)
    = 25$ (aug 9)
    =30$ (aug 10)

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I don't think you need a loop. You can use the DateDiff() function to count the number of days between the due date and today, and multiply. Also, why would you use text fields to hold a date? That will likely be problematic.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ducthang88 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    12
    oops sorry it is date not text my bad... datediff() eh?

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

Similar Threads

  1. Looping through a tbl to find a certain value
    By cwf in forum Programming
    Replies: 1
    Last Post: 05-17-2010, 04:02 PM
  2. Looping code for printing reports
    By Lockrin in forum Access
    Replies: 2
    Last Post: 02-09-2010, 05:48 AM
  3. Looping syntax
    By fadiaccess in forum Access
    Replies: 1
    Last Post: 10-23-2009, 02:57 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