Field Names

P

Parts Manager

Do field names have to be unique even if they are in different tables?

I have 10 tables and the first field in each table is ID; while it makes
sense that is what it is called, do I have to go further with the field
name?

For clarity I suppose I could use ItemId, VendorId, EmployeeId,
PurchaseOrderId, InvoiceId, etc...; but I thought maybe it wasn't needed
since the field name of ID is in different tables.

Tim
 
R

Rick Brandt

Parts said:
Do field names have to be unique even if they are in different tables?

I have 10 tables and the first field in each table is ID; while it
makes sense that is what it is called, do I have to go further with
the field name?

For clarity I suppose I could use ItemId, VendorId, EmployeeId,
PurchaseOrderId, InvoiceId, etc...; but I thought maybe it wasn't
needed since the field name of ID is in different tables.

Tim

There are conventions that would suggest either way, but there is no
*requirement* that field names be unique across tables. Do whatever makes
the most sense to you.
 
R

Rick B

It sure does make debugging and report, query, and form building easier if
everything has a logical unique name.
 
P

Parts Manager

"Rick B" <Anonymous> wrote
It sure does make debugging and report, query, and form building easier if
everything has a logical unique name.


I guess that is the part I didn't know if it would hurt. I am only still
trying to design the tables and have not delved into creation of the
database yet and the other parts needed. Since this is my first time in
Access, I didn't know if having long names of fields would get tiring typing
in while programming the database with Queries, Forms, etc...

I soon will see I suppose where having tblItem.Id, and tbleBoat.Id; are
easier to work with then tblItem.ItemId and tblBoat.BoatId. I think that is
why I chose having Id by itself, the table is labeled Boat, so if I call a
field, I think the structure for using that field will require indicating
what table I want the field to come from. Again, first time using Access
don't know how the naming convention works when using all functions.

Tim
 
J

Jack MacDonald

I find the opposite to be true - unique names are easier to work with.
When you create a query that has fields from two or more tables,
having fields with identical field names can be confusing. But your
mileage may vary...



I guess that is the part I didn't know if it would hurt. I am only still
trying to design the tables and have not delved into creation of the
database yet and the other parts needed. Since this is my first time in
Access, I didn't know if having long names of fields would get tiring typing
in while programming the database with Queries, Forms, etc...

I soon will see I suppose where having tblItem.Id, and tbleBoat.Id; are
easier to work with then tblItem.ItemId and tblBoat.BoatId. I think that is
why I chose having Id by itself, the table is labeled Boat, so if I call a
field, I think the structure for using that field will require indicating
what table I want the field to come from. Again, first time using Access
don't know how the naming convention works when using all functions.

Tim


**********************
(e-mail address removed)
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
 
D

Duane Hookom

I use a naming convention where each field in a table begins with the same 3
characters. For instance:
tblEmployees
empEmpID
empFirstName
empLastName
empDOB
emp...

tblProjects
prjPrjID
prjTitle
prjStartDate
prj....

tblOrders
ordOrdID
ordCstID (note related field in tblCustomers)
ordOrderDate
ord...

tblCustomers
cstCstID (note related field in tblOrders)
cstCustomer
cstContactFName
cst...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top