Linda,
The primary key being first and the foreign key being second is just a
convention I showed you. Doug is 100% correct in that the order of the
fields is irrelevant. However, as you design your tables, you should think
in terms of the order of the tables. When designing a table, ask yourself,
is there a higher order table above the table I am designing. For example,
say you have already designed a department table and now you are working on
an employee table. Employees work in different departments so the department
table is a higher order table than the employee table. When you have a
higher order table, it's primary key becomes a foreign key in the lower
order table and should be the second field in the lower order table. Thus
when you look at the map of the tables, it is readily apparent you need a
form/subform to enter departments and employees and the main form is based
on the departments table and the subform is based on the employees table. It
is also readily apparent that the LinkMaster/LinkChild properties are
DepartmentID.
You should always design all your tables (or at least most of them) before
you design your forms. Say in the above example you later design a
supervisors table and the real focus of your database is who works for which
supervisor and not what department an employee works in. Well, the higher
order table for the employee table just changed to the supervisor table and
SupervisorID then nedds to be the second field in the employees table.
DepartmentID just became irrelevant to employees and just became the higher
order table for the supervisors table. DepartmentID is no longer appropriate
in the employees table but now should be the second field in the supervisors
table. Had you designed the department/employee form/subform before
designing the supervisor table, you would then need to abandon most of that
work and rework your forms.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
When you are creating your tables, is there a certain order for the fields
to be entered? It appears from multiple sources that the Primary Key
should be the first field and then the Foreign Keys next. If you have
multiple Foreign keys, is there a certain order you should put them in?
Additionally, when you have a large number of just regular fields, is there
anything you should take into consideration for their order?
Thanks,
Linda