Autonumber Change

  • Thread starter Thread starter arranpatel
  • Start date Start date
A

arranpatel

Hi im new to the forum, so i haven't had a chance to look through to se
if this has been answerd - so if it has sorry!

Is it possible to change the autonumber in Access 2002 so that instea
of going 1,2,3,4 it changes to S1,S2,S3,S4 or ST1 ect...

Thanx alot if you can help m
 
Arranpatel,

No, this is not possible. Nor would it be desirable, actually. Do you
mean that all records in the table will have the same letter prefix? If
so, then whenever you need it to show with the S in front (which would
normally be for your purposes on form or report), it is very easy to put
it there. For example, you can use a calculated field in the query that
the form or report is based on, like this...
FullID: "S" & [YourAutonumberField]
Or similarly, you can put the equivalent of this in the controlsource of
a textbox directly on the form or report...
="S" & [YourAutonumberField]
Another way to do it, even simpler perhaps, is to set the Format
property of the textbox which is bound to the Autonumber field, to...
\S#

If, on the other hand, you mean that some records should have one
prefix, and other records can have another prefix, then maybe you could
post back with some more detailed explanation of how it is really
supposed to work, with some examples, and someone will be able to advise.
 
Hi im new to the forum, so i haven't had a chance to look through to see
if this has been answerd - so if it has sorry!

Is it possible to change the autonumber in Access 2002 so that instead
of going 1,2,3,4 it changes to S1,S2,S3,S4 or ST1 ect...

It is not possible. Access Autonumbers are numbers; S and ST are not
numeric characters.

You can use the Format() function to *display* the letter S in front
of every number, but it will be S for all records, not S for some and
ST for others. To get what you describe you will need some VBA code.
Could you explain how the decision whether the value starts with S or
with ST is made?
 
Im doing my a-level it coursework

2 of the tables in the database are called (staff, student)
it s a parking permit database which will be used to charge people for
permit parkin. however when soembody wnats to find out in the car park
who the car belongs to they will run a query which is linked to both
tables. the query will use the permit_id(seperate link table) to search
through the databse. becuase staff members and student members can both
get parking permits. becuase both tabels are linked to the one table i
want the students autonumber to change to S1,2,3 and the Staff to be
ST1,2 so that the autonumber does not confuse the input form
 
Im doing my a-level it coursework

2 of the tables in the database are called (staff, student)
it s a parking permit database which will be used to charge people fo
permit parkin. however when soembody wnats to find out in the car par
who the car belongs to they will run a query which is linked to bot
tables. the query will use the permit_id(seperate link table) to searc
through the databse. becuase staff members and student members can bot
get parking permits. becuase both tabels are linked to the one table
want the students autonumber to change to S1,2,3 and the Staff to b
ST1,2 so that the autonumber does not confuse the input form

thanks alot for your hel
 
Arranpatel,

Why have you got separate tables for staff and students? They're all
people, aren't they? Wouldn't it be more sensible to put them both in
one table, and then have a field in that table to indicate Status (i.e.
staff or student)?
 
Back
Top