Solved

Set value of a field with a button

Posted on 2014-09-03
3
169 Views
Last Modified: 2014-09-03
I have a tabular subform with fields expr1, time in, time out, and initials.
I would like to add a button next to each record that, on double click, sets the value of time out to now().
0
Comment
Question by:TIgerV
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40301650
You can set the value of a field like this:

Me.YourFieldNow = Now
0
 
LVL 36

Expert Comment

by:PatHartman
ID: 40301688
You don't even need a button.  You can put the suggested code into the double click event of the control you want to update.  

However, if you do use a button, the correct event to use is the click event.  It is important that interface actions be consistent across the board.  If in every other application (including windows) and in all your other forms, clicking once activates the button code, then that is how buttons should work on this form.
0
 

Author Closing Comment

by:TIgerV
ID: 40301698
Thank you!
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

808 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