Hi,
I am trying to check a date field to see if it is less than six months of today's date using VBA.
How can this be done. The field name to compare is DateOfExpiry
Khalil
Hi,
I am trying to check a date field to see if it is less than six months of today's date using VBA.
How can this be done. The field name to compare is DateOfExpiry
Khalil
You want code behind a form and reference field value of current record?
Something like:
If Me!DateOfExpiry > DateAdd("m", -6, Date()) Then
What event do you want to use?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks.
If I understand correctly, m stands for the months
-6 stands for less than 6 months
It worked for me after changing the > to <
Here is how it looks like:
If ([frmPassportsSubForm].Form![DateOfExpiry]) < DateAdd("m", -6, Date) Then
Khalil