primary key

Forum home » Delegate support and help forum » Microsoft Access Training and help » Primary Key

Primary Key

resolvedResolved · Low Priority · Version 2003

Beverley has attended:
Excel Advanced course
Access Introduction course
Access Intermediate course
Excel VBA Intro Intermediate course

Primary Key

If i want to set the Primary Key as a school identifying number ie SCH1 can i get acccess to copy that format but changing the number down the list to show SCH2, SCH3 etc or do i have to do each entry manually?

RE: Primary Key

Hi Beverley

The answer is yes......

Create a new column and call it SchoolID for example.
Set the data type of SchoolID field to an Autonumber.
Move down into the field properties of that field and add the following code to the Format property: "SCH"&

When you add a record in datasheet view this column will be completed for you by Access. SCH1
The next record will be SCH2 etc....

Best wishes,
Tanya

RE: Primary Key

HI I have done this and it works find down to SCH9 and then it goes to 1SCH0, is there anyway to change this to say SCH10?

Many thanks

RE: Primary Key

Hi Beverley

Try replacing the code I gave you with the following code
"SCH"0.
Put this in the format property of the SchoolID field. I tested this and it works with SCH10 etc

Tanya

Tue 25 May 2010: Automatically marked as resolved.


 

Access tip:

Changing MS Programs Text Size

A handy way to increase or decrease the size of text in Microsoft Word, Microsoft PowerPoint, Microsoft FrontPage, or Microsoft Publisher, first, select the text you want to resize.

Then, to increase the font size, press CTRL+SHIFT+>.

To decrease the font size, press CTRL+SHIFT+<.

View all Access hints and tips


Server loaded in 0.07 secs.