Buttons again

D

DaveB

I'm not sure why, but so far nothing that anyone has said
has worked. Perhaps I din't explain what I'm trying to do
well enough, so here goes again.

I created a button and next to it I have a field
titled "timeofcontact". I'm trying to get the time now ,
or the current time, to be posted in the "timeofcontact"
box whenever I click on the button next to it. Please
tell me in beginners language how I do this.
 
C

Cheryl Fischer

To have a command button enter the current time in a field, do the
following:

In the properties sheet for that command button, find the OnClick event and
click anywhere on that line and you will see a downward pointing arrow at
the right edge of the line. Click it and select Event Procedure. Then,
look for the small button to the right of the downward pointing arrow which
contains an ellipsis (three dots ...). Click this button to open the code
window. In the code window, type the following:

Me!TimeOfContact = Time()

If you want your TimeOfContact control to contain Date and Time, use the
following:

Me!TimeOfContact = Now()

hth,
 
R

Rick Brandt

DaveB said:
I'm not sure why, but so far nothing that anyone has said
has worked. Perhaps I din't explain what I'm trying to do
well enough, so here goes again.

I created a button and next to it I have a field
titled "timeofcontact". I'm trying to get the time now ,
or the current time, to be posted in the "timeofcontact"
box whenever I click on the button next to it. Please
tell me in beginners language how I do this.

You're doing a great job of explaining what you're *trying* to do. Why
don't you post the actual code you are using so we can see what is wrong
with it? Every response you've gotten on this has been correct so
something is getting lost between what is being suggested and what you are
actually doing.
 
K

kevinrea

is a sample for you Dave.

I did it in access 2000, so it should open with 2000 or later such as
xp.

let me know if you need it in access 97.

look at the code behind the button and behind the form on the form open
event.



kevin rea


+----------------------------------------------------------------+
| Attachment filename: sampletime.zip |
|Download attachment: http://www.MSAccessForum.com.com/forums/attachment.php?postid=110742|
+----------------------------------------------------------------+
 

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