How to auto update date when another field

xaxier

Registered User.
Local time
Today, 11:24
Joined
Apr 21, 2010
Messages
29
Hi all,

this might sound an easy question to most of the expert out there, but I have a hard time to do this as I am a total noob when come to programing.

I have a date field (DateSent) that I want automatically filled in when information in another field (SentDone) in another table is entered. In the SentDone Field, I have set the data set as Yes/No while the DateSent Field, I have set the data set as date/time

Please advice how this can be done so that whenever the user enter a Yes/No, access will automatically record the date in the (DateSent)?

Thanks in advance!!
 
In the On Click event of your Yes/No field put some code like;
Code:
If Me.YesNoFieldName = True Then
     Me.DateSent = [URL="http://www.techonthenet.com/access/functions/date/date.php"]Date()[/URL] [COLOR="SeaGreen"]'If you need a time stamp as well as the date use [URL="http://www.techonthenet.com/access/functions/date/now.php"]Now()[/URL][/COLOR]
End If
 
thanks, this look great :)
 
Hi there,

Just one more question. If let said the user unclick the yes/no field, are there any way to erase the date automatically?

Thanks in advance
 
Try;
Code:
If Me.YesNoFieldName = True Then
     Me.DateSent = Date() [COLOR="SeaGreen"]'If you need a time stamp as well as the date use Now()[/COLOR]
Else
     Me.DateSent = Null
End If
 

Users who are viewing this thread

Back
Top Bottom