Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add a date to a table - for audit 1

Status
Not open for further replies.

psarros

MIS
Feb 17, 2002
67
US
I have a form that has a button on it that performs a function. I need to know when that function was performed, so I have created another table.

What is the code to add the date and time into that table
 
Add a new column to the table underlying you form. Make this column of type DateTime. Put a control on the form that is bound to this field. It's up to you whether you want to have this control visible or not, but don't enable it since you never want anyone to change it. On the click of your button ...

Me.audit_date = Now()

Now() represents the system time and date at the moment your reference it.

You can also use Date() which will give you only the date.

hth

yamafopa!
 
I can't add it to the same table, there a thousands of records. It would be overkill. I want to update a separate table.
 
Perhaps create an append query that that you trigger with code.

And a calculated field in the query might be:
MyFieldCalc: Forms!MyForm!MyID

And another calculated field in the query might be:
MyDateTime: Now()

Best regards,
J. Paul Schmidt
- Putting Databases on the Web
- ASP Design Tips
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top