Solved

VBA code to activate timestamp button on Access 2007 form

Posted on 2012-03-16
5
1,028 Views
Last Modified: 2012-03-20
The Form in question, has four task categories and four adjacent time entry fields, currently users type in current time as they complete each task...and they complain about having to type.

I would like to create a command button for each time stamp, this would make it much easier for users to enter time as each task is completed.

I have very little experience in VBA.


Thanks much
0
Comment
Question by:lucyLuna
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 37728326
0
 

Author Comment

by:lucyLuna
ID: 37730615
@Dhaest, Thank you for the link...my problem now is:

What code I need to add to the command button's "on click" event, which will input" time() " into a field?

Also...is it better, or possible to write a macro for this function, instead of VBA?

It is likely I missed the solution in your reply...please point it out...I am new at this.

Thanks much
0
 
LVL 6

Accepted Solution

by:
Gugro earned 500 total points
ID: 37733108
Use this in the Button OnClick Event:

Private Sub MyButton_Click()
  Me.MyDateTimeFile = Now()
End Sub
0
 

Author Closing Comment

by:lucyLuna
ID: 37745358
Thank you so much, Gugro, your solution worked perfect!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

706 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

17 Experts available now in Live!

Get 1:1 Help Now