November 3, 200520 yr Hello all, I have been trying to make a small car rental program so that everytime I rent a certain car the mileage will always be correct. The car info is kept in a seperate file and I use the lookup function to pull over the Car Number, Plate, Yr, make etc,, but when I pull the starting mileage over I want it to be the ending mileage of the previous rental. I dont want the starting mileage to change on the rental form when inputting the mileage in. I hope this make sense. Thanks in advance.
November 3, 200520 yr You can sort your related rental history for that specific CarID and then take the last record's value from the EndMileage and set it to a the new record's StartMileage.
November 3, 200520 yr Author Thanks Mr_vodka I will give it a try. I didn't think about it that way. Scott
November 4, 200520 yr Hi OldFogey, Yes it might be faster. I personally never rely on the Max function to compensate for human typo error but thats a matter of choice. Your solution is just as fine.
November 4, 200520 yr I don't see how Max ( related::Field ) would be faster than Last ( related::Field ), especially when Field is not indexed.
November 4, 200520 yr Author Thanks for your input. I am new to this so it will take some experimentation to get it right. Any help is appreciated. Scott B)
Create an account or sign in to comment