?
Solved

VBA code to activate timestamp button on Access 2007 form

Posted on 2012-03-16
5
Medium Priority
?
1,079 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
[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
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 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

770 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