microsoft access courses - primary key

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » microsoft access courses - Primary Key

microsoft access courses - Primary Key

resolvedResolved · Low Priority · Version Standard

Dan has attended:
Excel Advanced course
Access Intermediate course

Primary Key

How do we combine the first to letters of FName and the first 3 letters of LName to create employee PK for dB?

RE: Primary Key

Hi Dan

To do this you would need to have all the details submitted to a form before they went anywhere the actual database. You would then need to write some code to get the letters that you need and join them. then submit to a database.

I would also say that the primary key has to be unique, so what would happen if two people had the same name?

I suggest you give you primary key a little more thought and make sure that there is no way that a duplicate will exist.

Hope this helps

David


 

Access tip:

Random sampling

Data is th key to a good database, therefore checking is essential.

A good way of checking data is by random sampling. You can do this in a query, by typing the follow:
1) In the Field box create a RandonID field eg. Randon Id: Rnd(fieldname])

2) sort the field
3)Right click and chage the properties for To value to be the number of randon records you want to see.

4) Change the set to Show row for Randon ID to be False, add all the other fields you want to see and the run the query.

View all Access hints and tips


Server loaded in 0.08 secs.