Again.. Defaulting to the next highest value

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.
 
V

Van T. Dinh

In the AfterUpdate Event of the Control1 which is bound to Field1, use:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top