naming convention for tables, queries and forms

hey guys,

could yall share what are some of the naming conventions yall use for tables, queries and forms?

it's very common to see the prefix tbl, qry, frm.

however i think that is quite obvious already and it takes away the prefix from being something more descriptive.

i would only use tbl, qry and frm in the case when my object name is the same but the object type is different e.g. tblSomeName, qrySomeName, frmSomeName

what are some of the naming conventions yall use guys? as the database grows bigger, this could be an absolute killer!!

also for build up queries i use:


any sharing of naming conventions will be most helpful!! thanks guys!! = ))
Who is Participating?
Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
Yes, as you know the main thing is that whatever convention you use, you must be consistent.
(If you must break with convention, make it an exception, not a rule...)

Lately I have seen a lot of schemas where the prefix is at the end (ex.: Customers_tbl, Orders_sfrm, ...etc)

This helps with sorting the similar objects

But like MX, I still stick with the LNC, (for the most part)

There is also more great info here:

DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
Here is a good reference on the De-Facto Access naming conventions pioneered by Stan Leszynski and Greg Reddick back in the early 90's, which became known as the L/R Naming Conventions (aka LNC Naming Conventions) - and is still pretty much the de-facto standard today.

And not directly mentioned, but avoid using any of these special characters in object and field names:

Avoid using the following characters: ,.~!@#$%^&*()+-=|\:;'<>?/"`[]{}  including Spaces!

Frank McCourryConnect With a Mentor V.P. Holland Computers, Inc.Commented:
Personally, I do something similar, but I format it as;

This way I keep associated tables forms and queries together.  I never use spaces.  I cannot tell you how many times I've seen space fudge things up!

It's really up to you and how you want it to be organized.  It looks like your off to a good start.
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
for example,...I try to use "btn" for command buttons...
Back when I was studying VB6, I learned that the was a "Command" object that used "cmd" as a prefix.
(...besides when you select it from the controls box, say "Button")

I also use chrt instead of cht (for charts)

So again, consistency is the key...

Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
I use my own version of LNC, but have taken a few liberties.

For example, I use "s" for a String variable:


I use "i" for Integer, "d" for Double, and so on. It can get somewhat messy at times, like with Decimal (in which case I use "dc"). I use "f" for Form, and "sf" for Subform, "r" for report, and so on. While "frm" is a bit more descriptive, "f" gets the job done.

The main thing, as others have said, is I'm consistent, and from project to project I can tell at a glance what type of variable I'm dealing with. That's the purpose of any naming convention, so as long as it serves the purpose, the job is done!

I think the concept of overly descriptive prefixes or suffixes defeats the purpose, and actually makes things harder. After all, is this:


better than:


The first is overly descriptive, and doesn't really tell you what it does - is it a subform for working with InvoiceDetails, or with InvoiceLineItems, or are they the same? Is is a Subform for a form named "InvoiceDetails"? Or something else.

Note this came from a project I'm working on now, and it's a fairly short example of overkill. There are other variables/objects with longer names than this ...
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
"I use my own version of LNC, but have taken a few liberties."

Similar to LSM also ... basically one letter prefixes for Variables.

Overall ... Less Is More.
I keep all of my object names as *short* as possible - since user is never going to see them.

For Forms/Subforms ... I want related objects to sort together for SURE. So -for example

frmInvoice                 'Main Invoice
frmInvoiceSubDt     'Invoice Details  (this is a subform on frmInvoice)
developingprogrammerAuthor Commented:
thanks guys for all your help = )

Jeff and Frank, i think that using the object type abbreviation as a suffix is actually a very warp (because it's new) idea - but actually the best thing.

i did some thinking and i think the most succinct way to express it is that -

- object type as a prefix tightly couples the sort order: it can only be sorted by object type
- object type as a suffix loosely couples the sort order: it can be sorted by object type and category

reason is Access already allows us to sort by object type. so adding the object type doesn't help. however, Access doesn't allow us to use the same names for tables and queries. and that's where the object type suffix come in to differentiate the two.

whao guys, really good discussion here. i really wish i could start over in my project and incorporate all these. naming all my PKs just as PK and my table, queries and forms with an object type suffix. oh well, hopefully i even survive through this project sigh.

but thanks once again so much guys, really good stuff! = )
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.