Autonumber records with pattern

M

Marco Alting

Hi

Is it possible to autonumber my records depending on a value? Something
like:

value = 440

autonumber = 440.1
440.2
440.3

etc.


The value change per input screen.


Thanks,
Marco
 
C

Cheryl Fischer

No, this is not possible. If you are using the AutoNumber data type, its
values are assigned automatically by the database and they are not decimal
values. To get the kind of numbering you desire, you would need to write
some code to create your own custom numbering system. You can do a search
at http://groups.google.com using "Access custom numbering" or similar as a
search criterion to find many ideas on this subject.
 
M

Marco Alting

Ok,

Now I changed the field to a number field, what do I need to do to be able
to write values like:

440.1
440.2
440.3
....
440.11

etc.

When I change the field to a double, it allows me to enter values with
decimals, but it then show a comma and need to have a dot in there....
 
C

Cheryl Fischer

The use of a comma as the decimal delimiter is set or changed in your
Windows Regional and Language Settings which is available via Control Panel.
 
T

Tim Ferguson

Now I changed the field to a number field, what do I need to do to be
able to write values like:

440.1
440.2
440.3
...
440.11

etc.

Actually, I still wouldn't do it like this.... You really have two separate
pieces of information, the [Value] and the SerialNumber, so they should be
in separate columns. You can (in fact, you should) make a Primary Key based
on the combination of the two. You then need some vba code behind the data
entry form that looks up the highest-so-far number for the given [Value]
value, adds one, and puts it into the new SerialNumber. Bear in mind that
you must prevent new records being added via vb, sql, Excel, datasheets,
etc.

If you want ready-rolled code, try googling for "custom autonumber".

Hope that helps


Tim F
 

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