Autonumber question (1 Viewer)

horsecow

Registered User.
Local time
Today, 19:10
Joined
Nov 28, 2002
Messages
16
Hello,

I'm making a fairly complicated database for me (being as this is the first ive ever made) for an A-level project. There are a number of tables which have a autonumber for an ID. Now i'd like the users of the database to be able to distinguish bewteen the IDs by eye so i'd like their to be some sort fo prefix for each autonumber in each table. For instance, Table A has autnumbers like A00001 and table B has autonumbers B00001.

My teacher couldnt help me with this in access, only in lotus smartsuite which is no good to me as i have access xp. Could someone show me how this is done in access? im sure it can be done, im just not sure how it would be done.

Thanks alot ( i think i may be frequenting these forums alot until the database is completed :))

BTW, i already saw the topic http://www.access-programmers.co.uk...adid=35156&highlight=serial+number+autonumber but was wondering if there was anything easier and more... well... automatic so that as soon as they enter a record it will do the autonumber straight away)
 
Last edited:

Jack Cowley

Registered User.
Local time
Today, 19:10
Joined
Aug 7, 2000
Messages
2,639
Remember that Autonumber is a method for adding a unique identifier to a record and is not designed to be a sequential numbering system. If you can live with that then you can add an addition text field to each table and set the default value to A, B or whatever you like. Now you can concatenate this field with your Autonumber field for display to the user in the format that you requested.

hth,
Jack
 

horsecow

Registered User.
Local time
Today, 19:10
Joined
Nov 28, 2002
Messages
16
thanks, that's given me another angle to look at it

cheers
 

Fastone

Registered User.
Local time
Today, 21:10
Joined
Nov 21, 2002
Messages
56
Jack Cowley said:
Now you can concatenate this field with your Autonumber field for display to the user in the format that you requested.

Which formula would you use because I'm trying to do the same thing (with a date and autonumber) but it is not giving me the correct results?
 

Jack Cowley

Registered User.
Local time
Today, 19:10
Joined
Aug 7, 2000
Messages
2,639
Depending on how you display your data you can use something like this in the forms On Current event:

Me.MyConcatenatedField = Me.MyAutonumberField & "-" & Me.MyDateField

MyConcatenatedField should be an unbound control on the form.

hth,
Jack
 

Users who are viewing this thread

Top Bottom