DateAdd

  • Thread starter dhoover via AccessMonster.com
  • Start date
D

dhoover via AccessMonster.com

For some reason I cannot get this piece of code to work. I'm trying to
figure if the ReportingDate (current month end) is not = to the clients
YearEnd or the YearEnd plus three month, or minus three months or plus 6
months the LBRRecd field should display "n/a"

The problem I am having it it figures invalid monthend dates (1/30, 7/30, etc.
) This is the code:

Date1 = CDate(DateAdd("m", 3, rst3!YearEnd))
Date2 = CDate(DateAdd("m", -3, rst3!YearEnd))
Date3 = CDate(DateAdd("mm", 6, rst3!YearEnd))



If rst2!LBR = "quarterly" And rst!ReportingDate <> Date1
And _
rst2!LBR = "quarterly" And rst!ReportingDate <> Date2 And
_
rst2!LBR = "quarterly" And rst!ReportingDate <> Date3 And
_
rst2!LBR = "quarterly" And rst!ReportingDate <> rst3!
YearEnd Then
rst!LBRRecd = "n/a"

End If
 
D

dhoover via AccessMonster.com

I answered my own questions, I used DateSerial and it worked perfect.
 

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