Re: Generating Numbers



mphil.star@xxxxxxxxx wrote:

On Aug 11, 10:24 pm, jonceramic <joncera...@xxxxxxxxx> wrote:

On Aug 11, 8:43 am, mphil.s...@xxxxxxxxx wrote:


I am creating a certain program and in that program i want to add a
field which will be creating numbers with text in sequence older "
Like MPL 001/08 to unlimited " And 08 be current year. This will only
be possible if that field is enebled, if the condition of enebling
this field still is false then the field returns the previous value
that is it maintances the previous record number.

please assist as soon as possible

I'd start by creating that field on the fly from 3 fields... rather
than storing that field as a single value.

What I mean is, have 3 fields.
TypeText
Counter
CurrentYear

Display of these values would then be:
[TypeText] & " " & format([Counter],"000") & "/" & [CurrentYear]

Then, you can apply logic on the values in the various fields.

You'll have to ask the question differently to get help with applying
the logic.

Jon


Thanks for your help but all am interested with is generation of
numbers or let me put it this way What can i do to autonumber field so
that each time i cancel the updation it maintains its original number
not creating another number

My first suggestion is to never add a record into a table that has is bound to a table with an autonumber.

Second suggestion is to create an unbound form to enter data and never add it to the table unless the person presses a Save button and is willing to commit that record.

Third suggestion is to use a LongInt and scrap your autonumber and create a method to update the field.

If you need sequence, don't use Autonumbers. People that use autonumbers don't give a flying F about sequences.
.



Relevant Pages

  • Re: Autonum field for Relationships and Replication
    ... > that due to the PK being a single autonumber field, ... that's risking your database because it depends on the ... enforce your definition of uniqueness. ... there's no reason to program your sequence. ...
    (microsoft.public.access.replication)
  • Re: Renumbering records
    ... use a two-column sequence instead, ... In fact, I don't really want true replication, but ... started getting erratic results in my autonumber field. ... Then the next time you copy an Access database to ...
    (microsoft.public.access.replication)
  • Re: updating values
    ... Access is a relational database ... ... Access tables store data, but you'll get better use of ... The other part is getting the sequence numbering. ... Access Autonumber is intended to provide a unique ...
    (microsoft.public.access.formscoding)
  • Re: Autonumber Question
    ... The problem with using Autonumbers as a sequential key is that you can (and ... will) lose numbers in the sequence. ... the autonumber value that would have been used is lost. ... >> Still is a good design concept to never use an autonumber field if it's ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Auto Numbering
    ... An autonumber is designed only to guarantee unique values not sequential ... If an uninterrupted sequence is important then don't use an autonumber ... As the Handling Agent's name is being stored in a column in the table ... person and a primary key, which can be an autonumber, such as ...
    (microsoft.public.access.gettingstarted)