html >> adding current date into Access using DW form

by Thinking Man » Thu, 26 Jan 2006 04:45:54 GMT

I've looked all over this forum finding similar solutions but not exactly what
I'm looking for.

Relatively simple. My Access 2002 database has a timestamp column using the
timestamp data type. My form has a hidden field which I wish to use to enter
the current date and time when a person submits data via the web form into the
database.

I can see the record set will produce the date and time, but the date and time
does not actually go into the timestamp column.

My hidden field in the form is called timestamp. I've tried using Date() -
i've tried using {NOW} but for some reason it fails.

The timestamp field has a value of
<%= DoDateTime((rstblOnline.Fields.Item("timestamp").Value), 0, -1) %>

Can anybody help me with this one?

Jerry



html >> adding current date into Access using DW form

by Mark Richards » Sat, 28 Jan 2006 02:56:48 GMT


First, be careful with naming conventions - timestamp. It might be reserved
somewhere.

Second, the hidden field should be readily available when the form posts as
the fieldname and accessible via javascript or (more familar to me) php.

I haven't worked with moving data over between the html session and a
particular format, like Excel, but once you see the field contents in, say, a
simple test javascript function (load it into alert()), then you can move on
from there.





html >> adding current date into Access using DW form

by JEREMY » Mon, 30 Jan 2006 02:09:44 GMT

Change the database not your code.
in access design view set the data type to "date/time".
At the bottom under the "general" tab find the line that says default value
and enter Now()
Now every time a record is added the date and time will automatically be
added to that column
Jeremy







Similar Threads

1. Adding Current Time & Date

Simply put, how can I add current time and date to my webpage?

All help is appreciated!

2. Add current date & time to hidden field - Adobe Dreamweaver

3. Add current date/time to an insert record?

Could someone recommend how I would go about adding PhP variables to a record 
when I execute the insert record behavior? 

 for example - how would I add the $activation_code variable to the Insert_sql 
below?  Can the activation_code variable be added to a binding?

 $activation_code = md5(uniqid(rand(), true));

 if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == 
"registration_form")) {
   $insertSQL = sprintf("INSERT INTO users (pass, masterpoint_range, 
preferred_system, first_name, telephone, email, last_name) VALUES (%s, %s, %s, 
%s, %s, %s, %s)",
                        GetSQLValueString($_POST['password'], "text"),
                        GetSQLValueString($_POST['masterpoints'], "text"),
                        GetSQLValueString($_POST['preferred_system'], "text"),
                        GetSQLValueString($_POST['first_name'], "text"),
                        GetSQLValueString($_POST['telephone'], "text"),
                        GetSQLValueString($_POST['email'], "text"),
                        GetSQLValueString($_POST['last_name'], "text"));

 Help would be appreciated.


4. How to update my access to current date?? - ASP

5. Saving current date and time in ASP and ACCESS

Hi all,

 Im developing a simple web page and Im new to ASP.

 I want to save the current date and time in my MS ACCESS table

 I have a field in MS ACCESS and the data type is Date/Time is this correct or 
do I have to have it in Text???

 what should be the code here???

 adoRecordset.Fields("date") = Request.Form(Now)


 Is this correct??? But Im getting an error which says its expecting a string 
....


 thanks for any help.









6. Inserting Current Date & Time SQL Server DB using ASP - Database Tutorial in ASP

7. current date in form

Hi,

hopefully this is a pretty simple question.

Does anyone know how to add the current date to a form.  I want it to show in a text field.  I've tried
<input type="text" name="date" value="<%=now() %>"> 

but this doesn't work and I've also tried

<input type="text" name="date" value="(GETDATE())">

any help appreciated, thanks in advance.

Lisa



8. default a form field to current date - Adobe Dreamweaver