Insert Date/Time to new field once a checkbox is clicked

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that I am using that has four status checkboxes (25%
Complete,50% Complete, 75% Complete, Complete). I want to record the
date/time to a set field in my database once the status button is checked. I
am assuming that I must use the "On Click" part of the properties window, but
am unsure on the code to enter in.

(I am using MS Access 2003)
Thanks in advance.
Aaron
 
I have a form that I am using that has four status checkboxes (25%
Complete,50% Complete, 75% Complete, Complete). I want to record the
date/time to a set field in my database once the status button is checked. I
am assuming that I must use the "On Click" part of the properties window, but
am unsure on the code to enter in.

(I am using MS Access 2003)
Thanks in advance.
Aaron

Everytime any one of these check boxes is checked?
Include that Date Field in the form.

Code each ckeck box's AfterUpdate event:
Me.[DateField] = Now()

Only if it is a new record?
Code each check box's AfterUpdate event:
If Me.NewRecord then
Me![DateField] = Now()
End If

The DateField will contain the date and time the last check box was
checked.
 
Thanks for the help and the quick response.

fredg said:
I have a form that I am using that has four status checkboxes (25%
Complete,50% Complete, 75% Complete, Complete). I want to record the
date/time to a set field in my database once the status button is checked. I
am assuming that I must use the "On Click" part of the properties window, but
am unsure on the code to enter in.

(I am using MS Access 2003)
Thanks in advance.
Aaron

Everytime any one of these check boxes is checked?
Include that Date Field in the form.

Code each ckeck box's AfterUpdate event:
Me.[DateField] = Now()

Only if it is a new record?
Code each check box's AfterUpdate event:
If Me.NewRecord then
Me![DateField] = Now()
End If

The DateField will contain the date and time the last check box was
checked.
 

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

Back
Top