Results 1 to 3 of 3
  1. #1
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50

    Code to multiply a number

    When an new overhaul record is entered for a component (ComponentID), I want the overhaul interval (OvhlInterval) for that component to double automatically, so that the application can keep repeating.


    Tables:
    TblCompletedOverhauls
    OvhlID (Pk), ComponentID, DateOvhled


    TblComponents
    ComponentID, ComponentName, OvhlInterval


    What is the best way of doing this?

  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,640
    As posted elsewhere:

    I would think the interval would remain fixed (x number of miles, hours, etc). In car maintenance applications I store an interval for various items (like oil change). I have a table with maintenance records, where I can find the last time a vehicle had an oil change. I have a table with the current odometer. I can compare the last service and the interval against the current odometer to determine when the vehicle is due for service again.

    To do what you're asking wouldn't be difficult. You could run an update query using the ID as a criteria, and double the value. However, I suspect it would only double the first time. In other words, if my oil change interval is 5k miles and I used your method, I'd double it to 10k. However, when it was serviced at 10k I wouldn't want to double it, as that would make it 20k and I want it done every 5k. So, I don't really think your doubling is the way to go.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    Haha thanks for being omnipresent everywhere... Guess we'll follow the thread on access-programmers!

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

Similar Threads

  1. Ado update for multiply records
    By thanosgr in forum Access
    Replies: 26
    Last Post: 03-16-2012, 01:26 PM
  2. Replies: 21
    Last Post: 02-14-2011, 02:51 PM
  3. Code to display latest record number field created?
    By rowardHoark in forum Programming
    Replies: 1
    Last Post: 01-31-2011, 08:03 AM
  4. Multiply front end on same computer?
    By efk0107 in forum Access
    Replies: 5
    Last Post: 01-25-2011, 08:39 AM
  5. Replies: 3
    Last Post: 06-08-2009, 08:20 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