My email address is wrongly spelt in my earlier request.
The correct email address is: DHURJSU@KELLYSERVICES.COM
Thanks,
Surya
>My email address is wrongly spelt in my earlier request.
>The correct email address is: DHURJSU@KELLYSERVICES.COM
>Thanks,
>Surya
Than your request is doubly impolite. This is a public newsgroup,
staffed (if that's the word) by unpaid volunteers like me, who donate
our time to reply to messages. I'm a self-employed consultant; I'll be
happy to provide private EMail support at my usual consulting rate,
which I'll send you upon request. But if it's worth my time to
volunteer to answer your question here, it should be worth your time
to come back to the newsgroup for the reply!
>>-----Original Message-----
>>Can you please help me to customize a field in Access
[quoted text clipped - 8 lines]
>etc.
>>All these numbers should be unique.
An Autonumber is *not* appropriate in this case; the only function of
an Autonumber is to provide a meaningless, almost-guaranteed (there
are bugs) unique key. They will always have gaps.
Instead, use a Long Integer "custom counter" field, created using VBA
code. You must (no option, table datasheets don't have any usable
events) use a Form to enter your data. The code can be very simple if
it's a one-user system or if there is little or no likelihood of two
people entering a new record at the same time, or it can get pretty
complex in a multiuser system. The simple code would use the Form's
BeforeInsert event:
Private Sub Form_BeforeInsert(Cancel as Integer)
Me!txtID = NZ(DMax("[ID]", "[YourTable]"), 1000000) + 1
End Sub
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public