Greater than statement

B

bladelock

I'm comparing two date values, I want to make sure the user does not go type
over 7 days from the dates entered. Example the user enters [Triage
dte]=01/01/2008 [reg dte]= 01/20/2008. I need to figure out how to make a
statement where the date is great that 7 days

I tried this but it's wrong:

If (Me![reg dte].Value > Me![triage dte].Value)+7 Then
<code>
<code>
End If

Any suggestions?
 
D

Douglas J. Steele

Your parentheses are incorrect.

If Me![reg dte].Value > (Me![triage dte].Value+7) Then

or

If Me![reg dte].Value > DateAdd("d", 7, Me![triage dte].Value) Then


Note that the .Value isn't strictly necessary, since the default property of
all text boxes is Value.
 

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

Top