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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date and Time

Status
Not open for further replies.

Elamranii

MIS
Feb 1, 2005
57
US
Is there a way to record the last time a user run a macro?
Let say a form with a text box and a button. When I click on the button the text box show me the last "date and time" the macro was ran.
Thanks.
Ismail
 
Should be fairly easy. If you create a function that inserts the Date/Time value into a table, then you would just call the function from the macro. Then when you click the button on the form, you would just use the DMax() function to get the value back from the table (or some variation of that idea).
The function would look like this
Code:
Function insertDateTime()
Dim strSQL 
strSQL = "Insert Into myTable([DateTimefieldName]) Values (#" & Now() & "#)"
Docmd.RunSQL strSQL
End Function

Then call the function from your macro.
You will have to adjust the table and field names to your table and field.

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top