
|
Regina Whipp |
|
The difficult I do immediately, the impossible takes a little bit longer. |
|
In database development it is a good idea to use some sort of naming conventions similar to the ones listed below by Leszynski/Reddick. Why? Because the next Programmer to come along should not have to try to figure out whether my query is a make table or delete query! They shouldn't have to guess whether the form is a main form or a subform. You do not have to use the one below as long as you implement some sort of naming convention. The ones I commonly use are in bold print. |
Naming Conventions |
|
byt - Byte f - Boolean (Yes/No) dbl - Double cur - Currency str - String stf - String (fixed length) var - Variant con - Use to indicate generic constants cmd - Command Button qry (or qdf) - Query (and QueryDef) tbl (or tdf) - Table (and TableDef) c - Count of some object h - Handle to a Windows object r - Parameter passed by reference g - Public (global) variable, program-level lifetime m - Private (module) variable, program-level lifetime s - Local variable, program-level lifetime (static variable) (none) - Local variable, procedure-level lifetime bof - Bound Object Frame chk - Check Box dcm - DoCmd bas (or mdl) - Module opt - Option Button fra - Option Group (frame) pge - Page of Tab Control shp - Rectangle (shape) scr - Screen sec - Section sfr - SubForm srp - SubReport tgl - Toggle Button cnx - Connection err - Error fld - Field idx - Index rel - Relation usr - User qxtb - Crosstab Query qlkp - Lookup Query qmak - Make Table Query qspt - Pass Thru Query fmsg - Message Form |
|
int - Integer lng - Long sng - Single dtm - Date obj - Object frm - Form txt - Text Box rpt - Report ctl - Control lbl - Label ocx - Custom Control grl - Group Level ole - Object Frame cbo - Combo Box ctls - Controls img - Image lin - Line app - Application lst - List Box hlk - Hyperlink prps - Properties brk - Page Break ref - Reference tab - Tab Control cnt - Container dbe - DB Engine doc - Document db - Database prm - Parameter prp - Property rst - Recordset grp - Group flqapp - Append Query wrk - Workspace qdel - Delete Query qflt - Filter Query fmnu - Menu Form bln - Balloon qtot - Totals Query quni - Union Query gra - graph |
|
Miscellaneous |
|
When it comes to Table names I like to use comprehensible names, ie…
tblClientProfile tblVendorProfile
I then use the Table names as prefix values for the field names, ie…
tblClientProfile cpClientID (Primary Key) cpFirstName cpLastName etc…
tblVendorProfile vpVendorID (Primary Key) vpCompanyName vpAddress etc…
Doing this serves two purposes for me…
The first, it insures that I do not use any Reserved Words, which Access would not like and I would have to use brackets around, like [Date] and hope Access still didn’t object. Access 2007 gets especially *upset* when faced with a field or table name that uses one of its favorite words..
The second, when reading my code months or even years down the road I know immediately which table the field comes from.
I also never use spaces or underscores… Spaces mean I have to bracket field names and/or table names. Underscores is just one extra character to type. Okay, now you’re thinking, what’s the big deal? Less typing… when you realize you’re going to *type* code and lots of it… you’ll do anything to make less typing! However, that is the only downfall, as long as you remember to bracket anything with spaces and put in your underscores, you’ll have no issues |
|
My Table Naming Conventions |