Add a date or time stamp to new records in access db

In some Microsoft Office Access tables, it is important to keep track of the date or the date and time when a new record is added. This is often referred to as a date or time stamp. You can use the Now or Date functions to have Access automatically fill in the date or time when a new record is added. Use the Now function to fill in the date and time, or the Date function to fill in just the date.

Add a date or time stamp field

  1. In the Navigation Pane, double-click the table to which you want to add the time stamp field.

    Access opens the table in Datasheet view.

  2. In the first blank column, double-click the column header labeled Add New Field, type a name for the field, such as Date Added, and then press ENTER.
  3. Select the column that you just added and then, under Table Tools, on the Datasheet tab, in the Data Type & Formatting group, select Date/Time in the Data Type list.
  4. Click the Microsoft Office Button Button image and then click Save, or press CTRL+S.
  5. On the Home tab, in the Views group, click View, and then click Design View.
  6. In the Field Name column, click your new field.
  7. Under Field Properties, on the General tab, click in the Default Value property box, and then type Now() or Date().
  8. Click the Show Date Picker property box, and then select Never from the list.
  9. Save your changes, and then close the table.

Each time you add a new record to the table, Access automatically inserts the date or the date and time in the Date Added field.

Age Calculator

This Javascript Age calculator is used to calculate your age.This age calculator is used to calculate the age,number of days and seconds from the given date or from the day your birth.

Features:

a) Age calculator is used to calculate the age.
b) This is free javascript calculator.
c) Copy the code from given textarea and to use this calculator.

Javascript to be pasted in head tags:

<!-- Script by hscripts.com -->
<!-- Copyright of HIOXINDIA -->
<!-- More scripts @www.hscripts.com -->
<script language="javascript">
var startyear = "1950";
var endyear = "2010";
var dat = new Date();
var curday = dat.getDate();
var curmon = dat.getMonth()+1;
var curyear = dat.getFullYear();
function checkleapyear(datea)
{
if(datea.getYear()%4 == 0)
{
if(datea.getYear()% 10 != 0)
{
return true;
}
else
{
if(datea.getYear()% 400 == 0)
return true;
else
return false;
}
}
return false;
}
function DaysInMonth(Y, M) {
with (new Date(Y, M, 1, 12)) {
setDate(0);
return getDate();
}
}
function datediff(date1, date2) {
var y1 = date1.getFullYear(), m1 = date1.getMonth(), d1 = date1.getDate(),
y2 = date2.getFullYear(), m2 = date2.getMonth(), d2 = date2.getDate();

if (d1 < d2) {
m1--;
d1 += DaysInMonth(y2, m2);
}
if (m1 < m2) {
y1--;
m1 += 12;
}
return [y1 - y2, m1 - m2, d1 - d2];
}

function calage()
{
var calday = document.birthday.day.options[document.birthday.day.selectedIndex].value;
var calmon = document.birthday.month.options[document.birthday.month.selectedIndex].value;
var calyear = document.birthday.year.options[document.birthday.year.selectedIndex].value;
if(curday == "" || curmon=="" || curyear=="" || calday=="" || calmon=="" || calyear=="")
{
alert("please fill all the values and click go -");
}
else
{
var curd = new Date(curyear,curmon-1,curday);
var cald = new Date(calyear,calmon-1,calday);

var diff = Date.UTC(curyear,curmon,curday,0,0,0) - Date.UTC(calyear,calmon,calday,0,0,0);

var dife = datediff(curd,cald);
document.birthday.age.value=dife[0]+" years, "+dife[1]+" months, and "+dife[2]+" days";
var monleft = (dife[0]*12)+dife[1];
var secleft = diff/1000/60;
var hrsleft = secleft/60;
var daysleft = hrsleft/24;
document.birthday.months.value=monleft+" Month since your birth";
document.birthday.daa.value=daysleft+" days since your birth";
document.birthday.hours.value=hrsleft+" hours since your birth";
document.birthday.min.value=secleft+" minutes since your birth";
var as = parseInt(calyear)+dife[0]+1;
var diff = Date.UTC(as,calmon,calday,0,0,0) - Date.UTC(curyear,curmon,curday,0,0,0);
var datee = diff/1000/60/60/24;
document.birthday.nbday.value=datee+" days left for your next birthday";


}
}
</script>

<!-- Script by hscripts.com -->

html code to be pasted in body tags:

<form name="birthday">
Date<select name="day" size="1">
<script language=javascript>
for(var j=1;j<32;j++)
document.write("<option value="+j+">"+j+"</option>");
</script></select>
Month<select name="month" size="1">
<script language=javascript>
for(var i=1;i<13;i++)
document.write("<option value="+i+">"+i+"</option>");
</script></select>
Year<select name="year" size="1">
<script language=javascript>
for(var k=startyear;k<endyear;k++)
document.write("<option value="+k+">"+k+"</option>");
</script></select>
<input name="start" onclick="calage()" value="Calculate" type="button"><br>
<input name="age" size="40" value="Result"><br>
You have been living for:<br>
<table style="border:solid green 1px"> <tr><td>In months:</td><td><input name="months" size="30"></td></tr> <tr><td>In days:</td><td><input name="daa" size="30"></td></tr> <tr><td>In hours:</td><td><input name="hours" size="30"></td></tr> <tr><td>In minutes:</td><td><input name="min" size="30"></td></tr> <tr><td colspan=2>Your next birthday will be in:</td></tr> <tr><td colspan=2><input name="nbday" size="40"><a href="http://www.hscripts.com" style="color:#3D366F;text-decoration:none;cursor:pointer;font-size:10px">hscripts.com</a></td></tr> </table> </form>

Usage:
a) Copy the above Javascript in your HTML file.
b) Create HTML form using the above HTML code.
c)The function calage() is used for finding the age. The result displays how many days you have lived for in months,days,hours and minutes.
d) Copy the code into your page and to use this calculator.

List of reserved words in Access 2002 and in later versions of Access

This article lists words and symbols that you should not use in field, object, and variable names in Microsoft Access 2002 and later versions of Access because they are "reserved words." Reserved words have a specific meaning to Access or to the Microsoft Jet database engine. If you use a reserved word or symbol, you may receive an error such as the following:

The wizard was unable to preview your report, possibly because a table needed by your report is exclusively locked.
If you use a reserved word, such as date, value, name, text, and year, in Access 2007, you may receive the following message:

The Name you supplied is a reserved word. Reserved words have a specific meaning to Microsoft Office Access or to the Microsoft Office Access database engine
For existing objects with names that contain reserved words, you can avoid errors by surrounding the object name with brackets ([ ]).

MORE INFORMATION


Because it is not practical to provide a list of all reserved words, such as built-in function names or Microsoft Access user-defined names, please check your product documentation for additional reserved words. Note that if you set a reference to a type library, an object library, or an ActiveX control, that library's reserved words are also reserved words in your database. For example, if you add an ActiveX control to a form, a reference is set, and the names of the objects, methods, and properties of that control become reserved words in your database.

-A

ADD
ALL
Alphanumeric
ALTER
AND
ANY
Application
AS
ASC
Assistant
AUTOINCREMENT
Avg
-B
BETWEEN
BINARY
BIT
BOOLEAN
BY
BYTE
-C
CHAR, CHARACTER
COLUMN
CompactDatabase
CONSTRAINT
Container
Count
COUNTER
CREATE
CreateDatabase
CreateField
CreateGroup
CreateIndex
CreateObject
CreateProperty
CreateRelation
CreateTableDef
CreateUser
CreateWorkspace
CURRENCY
CurrentUser
-D
DATABASE
DATE
DATETIME
DELETE
DESC
Description
DISALLOW
DISTINCT
DISTINCTROW
Document
DOUBLE
DROP
-E
Echo
Else
End
Eqv
Error
EXISTS
Exit
-F
FALSE
Field, Fields
FillCache
FLOAT, FLOAT4, FLOAT8
FOREIGN
Form, Forms
FROM
Full
FUNCTION
-G
GENERAL
GetObject
GetOption
GotoPage
GROUP
GROUP BY
GUID
-H
HAVING
-I
Idle
IEEEDOUBLE, IEEESINGLE
If
IGNORE
Imp
IN
INDEX
Index, Indexes
INNER
INSERT
InsertText
INT, INTEGER, INTEGER1, INTEGER2, INTEGER4
INTO
IS
-J
JOIN
-K
KEY
-L
LastModified
LEFT
Level
Like
LOGICAL, LOGICAL1
LONG, LONGBINARY, LONGTEXT
-M

Macro
Match
Max, Min, Mod
MEMO
Module
MONEY
Move
-N
NAME
NewPassword
NO
Not
Note
NULL
NUMBER, NUMERIC
-O
Object
OLEOBJECT
OFF
ON
OpenRecordset
OPTION
OR
ORDER
Orientation
Outer
OWNERACCESS
-P
Parameter
PARAMETERS
Partial
PERCENT
PIVOT
PRIMARY
PROCEDURE
Property
-Q
Queries
Query
Quit
-R
REAL
Recalc
Recordset
REFERENCES
Refresh
RefreshLink
RegisterDatabase
Relation
Repaint
RepairDatabase
Report
Reports
Requery
RIGHT
-S
SCREEN
SECTION
SELECT
SET
SetFocus
SetOption
SHORT
SINGLE
SMALLINT
SOME
SQL
StDev, StDevP
STRING
Sum
-T
TABLE
TableDef, TableDefs
TableID
TEXT
TIME, TIMESTAMP
TOP
TRANSFORM
TRUE
Type
-U
UNION
UNIQUE
UPDATE
USER
-V
VALUE
VALUES
Var, VarP
VARBINARY, VARCHAR
VERSION
-W
WHERE
WITH
Workspace
-X
Xor
-Y
Year
YES
YESNO
 
For more information about special characters to avoid using when you work with the database object names or the field names in all versions of Access, click the following article number to view the article in the Microsoft Knowledge Base:
826763 (http://support.microsoft.com/kb/826763/ ) Special characters that you must avoid when you work with Access databases

Source:http://support.microsoft.com/kb/286335