Expression to notify you of date expiry

G

Guest

Please help!!

I have a field in one of my forms where you enter the expiry date of a
passport. I need to create an expression that opens a msgbox notifying the
user that the passport has less than 6 months validity i.e. that from Today's
date there is either exactly 6months or less left on the passport.

I haven't a clue so any help would be greatly appreciated!!!! :)
 
K

Keith Wilby

Julia UK said:
Please help!!

I have a field in one of my forms where you enter the expiry date of a
passport. I need to create an expression that opens a msgbox notifying the
user that the passport has less than 6 months validity i.e. that from
Today's
date there is either exactly 6months or less left on the passport.

I haven't a clue so any help would be greatly appreciated!!!! :)

Something like this in the form's current event should get you started:

If DateDiff("m", Date, Me.txtDate1) < 6 Then
MsgBox "Whatever"
End If

Where txtDate1 is the name of your text box.

Keith.
www.keithwilby.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Expiry dates query 1
VBA For Expiry date 1
Cond Format: Expiry Date Alert 4
Highlight expiry date 4
Highlight expiry date 2
expiry date counting down 4
Expiry Date calculation 3
add number of months to date 3

Top