Solved

VBA code to activate timestamp button on Access 2007 form

Posted on 2012-03-16
5
1,035 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

943 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

4 Experts available now in Live!

Get 1:1 Help Now