[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2014-04-16
2
Medium Priority
?
3,298 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 39

Accepted Solution

by:
PatHartman earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 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