Solved

How use form command button to enter date and time into a table

Posted on 2014-04-16
2
2,590 Views
Last Modified: 2014-04-16
I have a form with a command button on it.  When the user clicks on it a field named "StartTime" in the bound table gets a value entered that represents the current date and time.  

Like:  4/16/14 14:32:08 PM


How can I do this?  I assume the field property in the table needs to be General Date.

--Steve
0
Comment
Question by:SteveL13
2 Comments
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
Comment Utility
In the click event of the button:

Me.YourDateField = Now()

If this is a required field, set the field to required in the table design.  If it is only sometimes required, you need to verify it in the Form's BeforeUpdate event and cancel the event if the user has not pressed the button.  

Also, if you don't want the user to be able to type in an old date/time, lock the field so that only your button can populate it and the user just can't type into it.
0
 

Author Comment

by:SteveL13
Comment Utility
Perfect!!!!   Thank you.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now