Welcome to the forum, DHOW.
First a word on etiquette. You have "Hi-jacked" this thread by posting your question in a thread started someone else. You should start your own thread and reference this thread (or one that is similar - if there is one).
Soooo.....
You have this in the control source of a control:
Code:
=DMax("[Mileage]![Ending Mileage]","[Mileage]","[id]= & '[Forms]![mileage details]![vehicle]'")
1) If the vehicle ID is a number, the syntax should be:
Code:
=DMax("[Ending Mileage]","[Mileage]","[id]= " & [Forms]![mileage details]![vehicle])
2) Putting this in the control source property of a control will only display the value on the form. The control will be unbound - the previous ending mileage will NOT be saved in the table.
3) To save the previous ending mileage, I would have code in the form before update event to push the previous ending mileage into a hidden control bound to the beginning mileage field.
The code would look something like
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.BeginMileage = DMax("[Ending Mileage]", "[Mileage]", "[id]= " & [Forms]![mileage details]![Vehicle])
End Sub
where "BeginMileage" is the name of the control bound to the beginning mileage field.
Or you can take a look on how I set up my mileage mdb.......see my previous post.( shameless plug)