Click button enter current time

T

Teddy

I am creating a form using Access 2003. One field on my form is Start. I
would like to add a button next to this field so that when I click the button
on the Form the current time will display in the field.

Can you tell me what I need to do to the Start field in the table and the
form where it exists in order to make this work?
 
R

Rick Brandt

Teddy said:
I am creating a form using Access 2003. One field on my form is Start. I
would like to add a button next to this field so that when I click the
button on the Form the current time will display in the field.

Can you tell me what I need to do to the Start field in the table and the
form where it exists in order to make this work?

In the code for the button's Click event...

Me!Start = Now()

You don't need to do anything to the table.
 
T

Teddy

This is awesome. Thank you for your help. When I use the code I get this
data “11/26/2009 9:55:30 PM†do you know how I can shorten it so that it
will only display the time such as 9:55 pm. I changed the format to medium
time on the table in design view but that didn’t seem to make a difference.
Any input is greatly appreciated thank you again for your help.
 
A

Andre

If you want to control the time format, you can also try
= Format(Time(), "Short Time")
 
T

Teddy

Just what the doctor ordered. This result is exactly what I was looking for.
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top