Results 1 to 4 of 4

Thread: Vehicle Maintenace Interval

  1. #1
    Join Date
    Feb 2009
    Posts
    4

    Vehicle Maintenace Interval

    Need to create a query that when a specified mileage interval is reached (5000 for gas and 7500 for diesel) then that record is displayed. Their are fields for both the current mileage and type of engine (gas, diesel). Any help is greatly appreciated.

  2. #2
    Join Date
    Mar 2006
    Location
    Oklahoma City, OK
    Posts
    184
    Quote Originally Posted by ocranger23 View Post
    Need to create a query that when a specified mileage interval is reached (5000 for gas and 7500 for diesel) then that record is displayed. Their are fields for both the current mileage and type of engine (gas, diesel). Any help is greatly appreciated.
    ocranger23,

    Without more details about your table structures, it will be very difficult to give you anything

    How do you determine the mileage intervals.

    Here is an example that may help:

    Referring to a Field in the Previous or Next Record
    Scroll down to to find:
    The following example demonstrates how to use the PrevRecVal() function in a form to create a mileage log. The custom function returns the previous odometer reading, which is used to calculate miles per gallon (MPG) for an automobile.
    It may not be exactly what you want, but it hopefully is close enough that you can modify it to meet your needs
    Boyd Trimmell aka HiTech Coach
    Microsoft MVP - Access Expert
    [SIGPIC][/SIGPIC]
    Office Programming 25+ years as a Software Developer specializing in:
    Business Process Management
    Accounting/Inventory Control
    Customer Relations Management (CRM)
    Electronic Data Interchange (EDI)

  3. #3
    Join Date
    Apr 2009
    Posts
    4
    Hi,

    Need to create a query that when a specified mileage interval is reached (5000 for gas and 7500 for diesel) then that record is displayed
    It depends how the mileage interval is added and what you mean by record is displayed. Do you mean a record on a subform or a seperate form??

    Either way you could do something like this:

    if me!enginetype = "gas" and me!mileage = 5000 then
    record is displayed code e.g. form.open
    elseif me!enginetype = "diesel" and me!mileage = 7500 then
    record is displayed code e.g. form.open
    end if

  4. #4
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    You would still need to display the record if the mileage interval is greater than 5000 for gas and 7500 for diesel. Most mileage intervals will not be exactly 5000 or 7500.
    Allan

Posting Permissions

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