Again.. Defaulting to the next highest value

  • Thread starter Thread starter Danny Jacobs
  • Start date Start date
D

Danny Jacobs

I posted this last week but I cannot find the posting on the newsgroup let
alone any responses that I might have had so...

Can anybody tell me how I can create a form control that automatically
defaults to the value of the previous record +1.

e.g. field1 field2
1 100
2 151
3 66
7 500 (Over-written example)
8

I want field1 to default to the previous value +1. If I over-write the value
then the rule will hold for the next entry.
 
In the AfterUpdate Event of the Control1 which is bound to Field1, use:

Me.Control1.DefaultValue = CStr(Nz(Me.Control1, 0) + 1)
 
Back
Top