?
Solved

Recording mileage on a form

Posted on 2016-11-28
2
Medium Priority
?
45 Views
Last Modified: 2016-11-28
I have a form that has three fields.  "Vehicle Used", "Starting Mileage" and "Ending Mileage".  The "Starting Mileage" field is to show the last entry made in the "Ending Mileage" field UNLESS it is the first record for that vehicle.  In that case the field is to show nothing.

Right now I have this in the control source of the x field but it doesn't work correctly:

=DMax("[EndingMileage]","tblTravel","[VehicleUsedID] = " & Nz([Forms]![frmTravel]![cboVehicleUsedID],0))
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 41904246
are you storing all three of these values in your table, or just the vehicleUsedID and the EndingMileage?

Personally, I would store all three in the table, bind them to the controls on your form, and use the cboVehicleUsedID AfterUpdate event to populate the value of the StartingMileage field (control).
0
 

Author Closing Comment

by:SteveL13
ID: 41904260
Excellent suggestions.  Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question