Nigel,
Place your code into the AfterUpdate event of the second field.
God Bless,
Mark A. Sam
>I want to be able to increase my ID field for each new record I enter, but
>I
[quoted text clipped - 10 lines]
>
> Thanks
Nigel - 27 Nov 2007 11:44 GMT
Thanks Mark, just what I wanted.
Nigel
> Nigel,
>
[quoted text clipped - 18 lines]
> >
> > Thanks
Rick Brandt - 27 Nov 2007 12:01 GMT
> Thanks Mark, just what I wanted.
That will work as long as you will never have more than one person entering
records at the same time. If you do you need to use the BeforeUpdate event of
the form and test for the NewRecord property.
Actually you need to test for the NewRecord property the way you are doing it as
well. Otherwise if someone edits the second field on an existing record the
number will be reassigned.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
>I want to be able to increase my ID field for each new record I enter, but I
>don't want to use an autonumber field in my table. I have used the following:
[quoted text clipped - 3 lines]
>automatically puts in the new ID number. What I want to do is for the form to
>put in the next ID number but only when the 2nd field has data entered in it.
This may not be the best for your situation, but it's worth
a thought...
Use your code to set DefaultValue instead of the Value.
Certainly not foolproof, but if your data-entry folks have
good understanding, and good discipline...

Signature
croy
Keith Wilby - 27 Nov 2007 15:57 GMT
>>I want to be able to increase my ID field for each new record I enter, but
>>I
[quoted text clipped - 15 lines]
> Certainly not foolproof, but if your data-entry folks have
> good understanding, and good discipline...
Default Value, I agree. I find the best way to implement that code is via a
"new record" command button - set up the form such that the only way to add
a new record is via your command button and save the record as soon as it is
created. Don't allow users to delete records, allow them to flag them as
deleted and query accordingly.
Keith.
www.keithwilby.com
Rick Brandt - 27 Nov 2007 18:56 GMT
>> I want to be able to increase my ID field for each new record I
>> enter, but I don't want to use an autonumber field in my table. I
[quoted text clipped - 11 lines]
> Certainly not foolproof, but if your data-entry folks have
> good understanding, and good discipline...
Also will not work with multiple users entering records simutaneously.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com