custom field number

C

chriske911

wich event do I need so that a new record gets a custom number?
regardless of how that new record is created
ie a copy of a previous record
the records are in a subform

I tried on the current event with if me.newrecord
but it also gets fired upon opening the parent form

thnx
 
V

Van T. Dinh

I rarely use Custom Number Sequence but if I do, I would use the
Form_BeforeUpdate Event (of the Subform's Source Object in your case).
 
C

chriske911

I rarely use Custom Number Sequence but if I do, I would use the
Form_BeforeUpdate Event (of the Subform's Source Object in your case).

I know but for invoices it is unavoidable :-(
the before update event works but it's annoying for the users cause now
the number gets created at the end of the invoice
it feels backwards even if it's really not that illogical ;-)

grtz
 
V

Van T. Dinh

You can use the Form_BeforeInsert Event but there are potential problems
with this on a multi-user system. Form example: UserA starts creating a new
Invoice and the system allocates InvNo 1. UserB starts another Invoice and
the system allocates 2. UserA then decides to undo the Invoice creation
then the InvNo 1 is not used but InvNo 2 is used (and you end up like
incremental AutoNumber Field!).

Actually, it sounds more logical to have the InvNo allocated after the data
has been entered. After all, it is a reference number and it is logical
that there exists some real data first for the reference number to refer to!
 

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