Check if a textbox is equal to today's date using VBA

Juddy

Registered User.
Local time
Today, 03:27
Joined
Jul 31, 2014
Messages
14
Hi,

When a form in my database is loaded I want access to check if a textbox on the form is showing today's date and if not send me an email. I'm quite new to VBA so not 100% sure what to do but I've had a few attempts and none seem to work. I have managed what is probably the hard part and can get it to email me but can't seem to get the 'If the textbox is not today's date then' bit right.

The textbox is linked to a table and the data type is 'Date/Time', it does show the time and the date so don't know if this makes a difference? The text box is [DateUpdated] and the form is [Site]. Can anyone help me with this?

Thanks in advance
Kim
 
the time does make a difference

if datevalue(nz(DateUpdated,0)) <>date() then ......
 

Users who are viewing this thread

Back
Top Bottom