Solved

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

Posted on 2014-04-16
2
3,030 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40005020
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.
1
 

Author Comment

by:SteveL13
ID: 40005027
Perfect!!!!   Thank you.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

717 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