• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1123
  • Last Modified:

VBA code to activate timestamp button on Access 2007 form

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
lucyLuna
Asked:
lucyLuna
  • 2
1 Solution
 
DhaestCommented:
0
 
lucyLunaAuthor Commented:
@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
 
GugroCommented:
Use this in the Button OnClick Event:

Private Sub MyButton_Click()
  Me.MyDateTimeFile = Now()
End Sub
0
 
lucyLunaAuthor Commented:
Thank you so much, Gugro, your solution worked perfect!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now