Setting Naming Conventions For IDs

Apr 25, 2013

Is it possible to set a naming convention for auto numbered records?

For instance in a table that holds information on customers, could you start the auto number scheme at something like 'cust01' rather than the normal autonumber scheme that's starts at 1 and continues.

Just so I am absolutely clear, table could be:

Customer_ID
First_Name
Last_Name

cust01
Ben
Robinson

cust02
Dom
Rodgers

cust03
Lilly
Balentine

cust04
Luke
Teal

rather than the normal:

Customer_ID
First_Name
Last_Name

1
Ben
Robinson

2
Dom
Rodgers

3
Lilly
Balentine

4
Luke
Teal

View Replies


ADVERTISEMENT

Naming Conventions

Mar 25, 2006

All,

I try to use common naming conventions wherever possible.
Every now and then I come across what should be common but I can't find a standard method to use.

It not really a huge problem, but as this is the General forum I thought I'd ask.

Does anyone have a good link with a long list of conventions?

http://www.mvps.org/access/general/gen0012.htm
http://www.databasedev.co.uk/naming_conv.html
http://www.acc-technology.com/namconv.htm

Are all good places to look.

Does anyone have a standard way to name a table which permenantly resides in the client but the data is very much temporary.

I use these tables a lot and was just interested.

No matter if there isn't one, just seems a good idea to open up a discussion for anyone else who wastes time like I do on the name of objects etc. rather than doing the work:-)

Any and all ideas on the subject most welcome.

Cheers, I hope this becomes a useful thread.

View 12 Replies View Related

Naming Conventions

Jul 24, 2007

Following on from entries in a previous post (see http://www.access-programmers.co.uk/forums/showthread.php?p=612071#post612071 ) I wondered what people considered to sensible naming conventions.

For example should a table be called "Order Details", "Order_Details", "OrderDetails" or "tblOrderDetails".

Should variables in VBA be given a prefix which indicates their type eg strString or intInteger etc.

Lets have your views.

View 14 Replies View Related

Naming Conventions

Apr 15, 2005

When I started using Access excel had been my closest app. to a database.

My first attempts to build a database failed because I tried to build the database like sets of excel sheets.

Any ways I then discovered Normalization, that helped a lot.
Now I am wondering about naming rules.

I have seen a few examples like:
ThisTableName,
strThisFieldName,
this_field_name,

Is there one standard or method or is this just user preference?

View 7 Replies View Related

Naming Conventions (possible Sticky)

Jan 25, 2008

Not only do a lot of people not format code (nothing a copy/paste dump of 300 lines with no spacing), they use control names like textbox1, combo47, and form12. It drives me bonkers. This is in part from Expert One-on-One Microsoft Access Application Development. Please read it and understand it. (The book isn't bad either.) Reagrdless of whether or not you agree with it, the point here is that you use some sort of naming convention, even if it's not this one as variants exist. Without it, maintaining your code is exponentially harder, and asking for help in here without some sort of standard convention is far less likely to get a response.That is all. :)Leszynski Naming Conventions (http://en.wikipedia.org/wiki/Leszynski_naming_convention)

View 4 Replies View Related

General :: Database Naming Conventions

Feb 12, 2013

I'm not talking about naming conventions as in tblThis or qryThat, but I have 100+ queries, many of which do similar things from slightly different angles - e.g. a query that gives the total sales per store per month; the same query but per store per product per month; the same query but per sales manager per store per month etc. And these are then used in queries further up the tree that also have similar but slightly different results.

So is there an example database anywhere that I can download that has a decent amount of queries, and a sensible naming convention? I think I'm tying myself in knots because I have only a few tables but lots of queries (for data analysis), whereas most databases I see have lots of tables and a handful of queries.

View 4 Replies View Related

Naming A Field In A Query

Nov 4, 2005

Hi,

I need to name my field in my select query
i.e : - name: [...

but instead of it just being text, i need it to calculate its name by month i.e
Month([Starting date:])+1

On my query i ask the user to input a starting date and i then work out information based on that. How can i name the a calculated month

Thanks
k0r54

View 1 Replies View Related

Query To Xls (naming Problem)

Dec 12, 2007

i have the following code and it works fine makes a xls called trash

now i want to be able to name the xls myself (via a form)
form called xlsexport
and the field i wil have to name it willb e called xlsname

is it a simple case of

objActiveWkb.Worksheets(1).SaveAs FileName:="c:[form]![xlsexport]![xlsname]- this doens't sound right to me ??

code below( yes theres some bits in there i need to tidy i know)


Private Sub Command0_Click()

Dim dbs As DAO.Database

Dim rstGetRecordSet As Recordset

Dim objXL As Object
Dim objCreateWkb As Object
Dim objActiveWkb As Object

Set dbs = CurrentDb
Set objXL = CreateObject("Excel.Application")
Set objCreateWkb = objXL.Workbooks.Add
Set objActiveWkb = objXL.Application.ActiveWorkbook

objXL.Visible = True
objActiveWkb.Sheets.Add
objActiveWkb.Worksheets(1).Name = "Trash1"
Set rstGetRecordSet = dbs.OpenRecordset("Trash")
objActiveWkb.Worksheets("Trash1").Cells(1, 1) = "test"
objActiveWkb.Worksheets("Trash1").Cells(2, 1).CopyFromRecordset rstGetRecordSet

' note replace names with correct qry
'objActiveWkb.Sheets.Add
'objActiveWkb.Worksheets(2).Name = "ABC"

'Set rstGetRecordSet = dbs.OpenRecordset("ABC_Query_Name")

'objActiveWkb.Worksheets("ABC").Cells(1, 1).CopyFromRecordset rstGetRecordSet



objActiveWkb.Worksheets(1).SaveAs FileName:="c: rash.xls"

objActiveWkb.Close

Set objActiveWkb = Nothing
Set objCreateWkb = Nothing
Set objXL = Nothing
rstGetRecordSet.Close
dbs.Close
Set rstGetRecordSet = Nothing
Set dbs = Nothing

View 4 Replies View Related

Naming Combo Boxes

May 22, 2006

Hi folks,

What is the abbreviation you use in MSAccess when naming combo boxes?

i.e a label is abbreviated using lbl.

Memory blank so appreciate some help thanks!

View 2 Replies View Related

Automatic Document Naming

Jan 20, 2015

I'm looking to design a form in Access that has a documents number field. Ideally, this field would auto-generate a document number based on a logical naming convention.

View 7 Replies View Related

Modules & VBA :: Naming New Archive Table

Jan 8, 2014

I have a Database in which I would like to archive data once it is now longer actively being used. I have VBA code that does everything i need it to, however I would like to name the new archive table related to the dates in the data being archived. Below is the code I am using to archive and delete the information from the main table.

Code:
Dim strSQLCreate As String
Dim strSQLDelete As String
Dim strArchiveTableName As String

[Code].....

I know it will be in the "strArchiveTableName" variable, I am just not sure how to pull the dates out of the data being moved. The TestData table holds a date and time for each test, and the earliest and latest dates is what i want to append to the table name.

For example: Currently "tblTestData_A102Archive"What I want "tblTestData_A102_1/1/2012-1/1/2013"

View 3 Replies View Related

General :: Naming Of Tables / Queries

Dec 19, 2012

Im putting up my Access table/query names for critique, because at some point Ill have to hand over this database to someone else and I want to see how they might react. So if you opened a query list and saw the list below, would you be able to find your way around, or are there too many similar looking queries?

Some of the queries are made up of 6 or 7 of the other queries. I find its easier to see what going on if they are separated out into individual queries, rather than throwing them all into a single select statement, and it means I can re-use things that I know work.

I get stuck on using plurals vs singular (e.g. StoresDeductions or StoreDeductions); how much detail to put in (e.g. BrokersChainsStoresCasesByMonth); how to indicate totals or being grouped by e.g. month; how to indicate date parameters, i.e. whenever a query says MonthRange it asks for this range, and any queries built on top of this one also have MonthRange in their name.

Code:

AccountsTotalNumStores
BrokersChainDeductionsMonthRange
BrokersChainDeductionsMonthRange_Crosstab
BrokersChainNumStores
BrokersChainsTotalsByMonthRange_Crosstab2
BrokersChainTotalsByMonth
BrokersChainTotalsByMonthRange
BrokersChainTotalsByMonthRange_Crosstab
BrokersChainTotalsMonthRange

[code]....

View 4 Replies View Related

Modules & VBA :: Naming A File - SOW Number

Oct 23, 2013

I'm currently working with Access 2007 building a way to create PODs to clients. I have most everything laid out, one problem I can't seem to get around is naming the file the SOW #. Below is the code:

Function Run_all_PODs_01()
Dim myPath As String
Dim name As Object

DoCmd.OpenQuery "Q5 SOW bill requested data points all", acViewNormal, acEdit
DoCmd.OpenQuery "Q5 SOW bill requested All 01", acViewNormal, acEdit

[Code] ...

I can't seem to get the name to equal the SOW number.

The table that I'm trying to reference is "SOW bill requested data points" it is a basic table one row with a column header as SOW #. I'm not sure how to tell it name the file that data point in the column.

View 4 Replies View Related

General :: Changing Naming Schema

May 28, 2013

I have taken over exisiting databases and the names for the tables,forms,queries,reports are not technically named correctly.. What would be the easiest way to rename everything accordingly:

tbl for table
qry for query
rpt for report
mcr for macro
bas for module
frm for form.

Of Course they have names but it is hard to tell when viewing a query for instance if you are looking at a table or a query.... in the SQL View.

View 14 Replies View Related

Error 2465 With Subform Naming Convention!

Jan 25, 2006

I've searched and experimented, but to no avail...

On a form (frmWorkOrder) , I want to “call “ a property on a subform (Named sfrmDocument). In order to disable that subform.

Thus far I’ve narrowed the error to:

Me!sfrmDocument.Form.Enabled = False
Me!sfrmDocument.Form.Locked = False


This seems to be the way that http://www.mvps.org/access/forms/frm0031.htm would handle it. Someone's suggestion and it seemed to work before ...

Maybe I’m reading it wrong!! At any rate, I get the error 2465 Application defined or object defined error.

Am I forgetting something ? Help!!

View 4 Replies View Related

Modules & VBA :: Output Report To Excel With Naming

Aug 19, 2013

Been hunting a round looking for some code that will output my access report to excel but more inportantly add a unique field from the report to the name of the file. example would be [FileName] & [ReferenceNo].xls.

View 2 Replies View Related

Forms :: Naming File Exporting To Spreadsheet

May 10, 2014

I am exporting a single record to a spreadsheet. The code I have works fine. The problem is I want to have the spreadsheet contain the information that is in one of the forms textboxes, in this case a dogs name.

I have created a query to get the dogs name which works but I dont know how to get that query to run and then be put in the file name.

The code that I have is below

Code:
Private Sub btn_ExportDog_Click()
Dim strday As String 'The date
Dim sDest As String 'Where the file will be copied to
Dim sSource As String 'The name of the file to be copied
Dim strDogName As String 'The name of the dog that is geting exported
Dim strBackUp As String
strBackUp = "c:GPandDetectionDogTrainingLogBackUp"

[Code]...

View 1 Replies View Related

Modules & VBA :: Excel Export Naming Convention

Jun 8, 2015

I would like to add the "Month" of the information queried to my file name at export if possible. I included my current code and an example of how I would like the title to read.

DoCmd.TransferSpreadsheet acExport, 10, "tblStarzIncentivePayoutExport", "C:StarzExportsIncentive Payouts" & " " & "Ran" & " " & Format(Date, "mm-dd-yyyy")

I would like the file to be named:

Incentive Payouts "Month out of the date ran in the query" Ran 06/08/2015

Is it possible to do?

View 1 Replies View Related

Forms :: Naming Form Controls Same As Field Names

Jun 13, 2013

Is it poor practice to name form controls with the same name as the field names?

View 5 Replies View Related

Modules & VBA :: Word Naming And Emailing Attach From Access 10?

Apr 21, 2015

I need to create a word file (it needs to be word) based on template (not a very complicated template) max 1 to 1 and 1/2 pages long.

the word doc needs to be named from the recordset but for now assume 12345.doc and the next one will be 12346.doc etc (I have a unique number system - available from tables /query .

i can either make the word doc in code or use a template (template would be better) recordset could have 20-30 in it each time i run it - but to be run every week

second half is how to email this out. i had in mind a email system

email to . test@testhotmail.xyz
file attach = this folder where the docs are store and attach 12345

in a loop

so either

create word file - email word file in a loop each time or create all the word files and then send them individual

View 4 Replies View Related

Modules & VBA :: Check For Documents With Specific Naming Structure

Apr 30, 2014

I want to hit a button and then it scans for a file on a server and return with a message box saying if it exists or not.

I want it so when I am on a Specific record it will search for certain requirements.

All the file names are pdf files with the same naming structure

SIT yy m(m) dd Last Name Unique Identifier
Example:
SIT 14 5 21 Smith ABCD1234567
SIT 14 10 21 Smith ABCD1234567

So I hit the button it sweeps the file path and looks for documents with this naming structure.

Last Name and Unique Identifier are fields within the db.

Last Name = txtLName

Unique Identifier = txtUniqIden

So far I have the following:

Code:
Dim strDirName As String
Dim strDirPath As String
Dim strDirName As String
Dim strDirPath As String

[Code] ....

So Far it works and I used the actual name of the items an it finds them but I need to up each record.

I have no clue how to begin with the strDirName. How to get it to scan the file name in a specific format.

View 3 Replies View Related

General :: Naming Of Tables / Queries / Forms And Reports For Identification

Sep 22, 2013

Is there any systematic way of naming Tables, Queries, Forms, and Reports in order to identify easily which of them are connected to each other?

View 1 Replies View Related

Modules & VBA :: Naming Range To Export Data To Access Table?

Dec 15, 2014

I am trying to write code in an excel worksheet to try to export excel data to a table in access.

The range in which the data is situated in excel varies. So the range address varies with the data. After a lot of searching I wrote the following code which works for a range which is fixed. The code is the following:

Dim acc As New Access.Application
Range(Range("b22"), Range("b22").End(xlDown)).Select
ActiveWorkbook.Names.Add Name:="ghazla", RefersTo:=Selection
acc.OpenCurrentDatabase "D:PayRollFactoryJasminePayroll.accdb"
acc.DoCmd.TransferSpreadsheet _

[Code] .....

As one can see from the first two lines of code I am trying to first delineate the range and then to name it. The intent is to name the range "ghazla" and so to cater for the fact that the extent of data varies.

The code works with the fixed range ="Sheet2$B140". However what I need to do is to adjust the code so that I can insert "ghazla" as the range name so that this can vary.

View 5 Replies View Related

Forms :: Refresh Pivot - Form Name Not Following Access Object Naming Rules

Sep 26, 2014

Access 2010 doesn't seem to like the last line. It gives me an error saying the form name doesn't following access object naming rules.

Sub update_subform()
Dim dbsCurrent As Database
Dim qryD As QueryDef
Dim strSQL1 As String, strSQL2 As String, strSQL3 As String
Dim mytmp As String
Dim proc As String, myot As String

[Code] .....

View 5 Replies View Related

Naming A Field Based On A Value From Another Field?

Dec 12, 2007

Hi all,

Is it possible to name a field (heading) based on the value of another field?

At the moment the code looks someting like this:

Sum(IIf([START_DATE]<=[CurrentMonth],IIf([END_DATE]>=
[CurrentMonth],[COST_PER_UNIT],0),0)) AS [ThisMonth Rate]

I would like to name the field based on the value of another field in the same table instead of the static [ThisMonth Rate]

Thanks again
Jules

View 3 Replies View Related

Setting Up A New Db

Feb 15, 2007

Hi Guys,

ok I work a lot on databases but have recently been asked to set up an access database for my team. We are a marketing team within a large insurance company and need a small access database for MI and project management.

I have made a start on this and going well so far but there are some things I need it to do that I dont know how :P

Ive never messed about with Acess before so bare with me :P ok so this is what im looking for, any help would be greatly appreciated.

I have set up various tables for look up wizards for some of the menus on another table I designed for the raw data entry.

I need two tables, two forms - one table for very basic generic data such as

- Job Number
- Description
- Business Unit
- Owner
- Due Date
- Completion date

I then need to drill down into this to add more information, so its basically two tables on top of each other with co-dependencies.

So for example one of my team enter a new project at the very basic lvl, they have a job number, they know what business unit it is for and they know the date its due, as time goes by and work is done on the project I want them to be able to click on a button that takes them to another form where they can enter information that is linked to the original information.

So they search for job number 00000 and come up with the above data on the first form, I want them to then click on 'Project Information' button and be taken to another form that has a lot more stuff on there, like a description, complications, notes, links to documents etc etc. I tried to do this linking two tables together but it doesnt work as the two forms/tables are not co dependend and are irrespective of each other.

Does this make any sense ? and does anyone know how I might make this work ? Please let me know if I am not clear and I will try to explain as best I can

I would also like to change the form 'theme' aswell and have my companies logo transparent behind the data fields etc, anyone know how to do that as I only have the option to use the standard themes.

Any help would be greatly appreciated

Sleek

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved