Order of Fields

  • Thread starter Thread starter LMB
  • Start date Start date
L

LMB

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
 
Linda,
Your impressions are correct. As for regular fields you
might want to create them thinking of how they would
appear in a form from top to bottom, left to right. The
field list in the forms design view will list them in the
order in which you created them in the table.
Geof.
-----Original Message-----
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?
 
Realistically, there's no reason for the fields to be in any specific order.
It's a generally accepted convention that the primary key be first, but it's
certainly not mandatory.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



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
 
I seem to recall that memo fields should be last. If they
aren't you may have problems exporting them to Excel or
using VBScript in an html file to query an Access
database. A pretty obtuse issue but it did plague me once.
Wouldn't return more than 256 charatcters.
Geof.
-----Original Message-----
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?
 
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
 
Back
Top