Date( ) versus Now ( )

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

Guest

I have a database with a check box that, when checked, enters "today's" date.
This date should not change so do I use Me.letter_date = Date( ) or
Me.letter_date=Now( )?
If I uncheck the box the date stays there - is there anyway to make it clear
the date?
 
The difference between Date() and Now() is that Date() returns the current
date and Now() returns the current date and time. If you include the time,
this could cause you problems later when you try to filter the results. If
no time is entered, midnight is assumed. So, if you enter a time and then
check to see if the value is <=Date(), it will fail if the date is correct
but there is a time later than midnight.
 
Kate,

Wayne has answered your first question. I will have a go at the second...

On the After Update event of the checkbox:
If Me.YourCheckbox Then
Me.letter_date = Date
Else
Me.letter_date = Null
End If
 
Many thanks - I'll try them both out on Monday!

Steve Schapel said:
Kate,

Wayne has answered your first question. I will have a go at the second...

On the After Update event of the checkbox:
If Me.YourCheckbox Then
Me.letter_date = Date
Else
Me.letter_date = Null
End If
 
Back
Top