Help with validation rule

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Electricsuit

    #1

    Help with validation rule

    I have a database that I use to track odometre readings. Several
    vehicles are tracked. As you can imagine, if the wrong vehicle is
    entered for the given mileage, it will through off reporting. I would
    like to include some kind of validation or error checking.

    1) Display or check against the last entered record for the vehicle
    (by DATE).

    2) Then doesn't allow the new entry to be less than the last one or
    500 km more than the last one.

    I'm by no means an expert with Access.

    Magic
  • Tom van Stiphout

    #2
    Re: Help with validation rule

    On 11 Mar 2005 05:42:46 -0800, electricsuit@ya hoo.com (Electricsuit)
    wrote:

    This is somewhat hard to do in a validation expression, but you can
    write some code in the Form_BeforeUpda te event.
    You can use DMax function to get the max odometer reading for that
    vehicle.
    If you have lots (>10,000) of rows, a parameter query may be much more
    efficient, but requires more skills on your part.

    -Tom.

    [color=blue]
    >I have a database that I use to track odometre readings. Several
    >vehicles are tracked. As you can imagine, if the wrong vehicle is
    >entered for the given mileage, it will through off reporting. I would
    >like to include some kind of validation or error checking.
    >
    >1) Display or check against the last entered record for the vehicle
    >(by DATE).
    >
    >2) Then doesn't allow the new entry to be less than the last one or
    >500 km more than the last one.
    >
    >I'm by no means an expert with Access.
    >
    >Magic[/color]

    Comment

    • Trevor Best

      #3
      Re: Help with validation rule

      Tom van Stiphout wrote:[color=blue]
      > On 11 Mar 2005 05:42:46 -0800, electricsuit@ya hoo.com (Electricsuit)
      > wrote:
      >
      > This is somewhat hard to do in a validation expression, but you can
      > write some code in the Form_BeforeUpda te event.
      > You can use DMax function to get the max odometer reading for that
      > vehicle.
      > If you have lots (>10,000) of rows, a parameter query may be much more
      > efficient, but requires more skills on your part.[/color]

      Then add some more code when the vehicle has its engine replaced :-)

      --
      This sig left intentionally blank

      Comment

      Working...