click on check box to add an entry date

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

Hi

Can some one help me
What i want to do is when i click on a check box in a record it puts the
current date and time in a text box or feild can this be done

Thanks


Greg
 
Hi

Can some one help me
What i want to do is when i click on a check box in a record it puts the
current date and time in a text box or feild can this be done

Thanks


Greg

Yes, but I'd suggest skipping a step; you can put in some simple code
to let the user just doubleclick a textbox and store the current
date/time.

With the checkbox, put code in the checkbox's AfterUpdate event:

Private Sub chkMyCheckbox_AfterUpdate()
If Me!chkMyCheckbox = True Then ' leave this out if you always
' want to update the date field, leave it in to set the date
' only when the user sets the checkbox to True
Me!txtDateTimeField = Now()
End If ' leave this out too if you leave out the If
End Sub

To doubleclick, use txtDateTimeField's DoubleClick event and just set
Me!txtDateTimeField to Now().
 
Thanks john

That works fine except when I check the check box on the next record it
globally changes the time and date to all the records to present time and
date what I want to do is when I check( tick) the checkbox it stores the
current time and date for that particular record and when I got another
record it stores the current time and date.
so in the future I can see when I made a particular record entry

Thanks

Greg
 
That works fine except when I check the check box on the next record it
globally changes the time and date to all the records to present time and
date what I want to do is when I check( tick) the checkbox it stores the
current time and date for that particular record and when I got another
record it stores the current time and date.

It sounds like your date/time textbox is unbound, i.e. it's not being
stored in any table record. If you don't store the date/time field in
the table then you CAN'T do what you ask!
 
Back
Top