Include Autonumber as part of new value

Jonno

Registered User.
Local time
Today, 04:28
Joined
Mar 17, 2003
Messages
74
On an AfterUpdate event in a field, I have a simple piece of code which builds a unique reference number for a record, made up of 4 parts:

"WEYRA" + "REF" + "Autonumber" + "03"

The ref is input by the user, so if the user was to enter "DBASE" as a ref, the ref number built would be

WEYRADBASE0103

Forms!f0!Text87 = "WEYRA" me!text4 + forms!f0!text48 + "03"

The trouble I am having is the inclusion of the autonumber field value in this, (Text48). It works fine without including the autonumber, otherwise no joy.
Is there a special way to reference autonumber values in fields on forms?
Will appreciate any pointers!

Jon
 
Since the Autonumber already give the record a unique number why complicate matters?
 
The reason is that the user specifically requires a "meaningful" reference generated automatically...
 
Jon,

You can use the DMax function (and add 1 to its return) to
generate your "key". There are plenty of examples in Help
and on this forum.

Wayne
 

Users who are viewing this thread

Back
Top Bottom