Hi I'm using the following code as a filter for a report.
I'm running the report from 4/1/15 to 6/30/15
The problem I"m having is the effective date column is showing 7/1/15 (based on the date passed)
when I step through the code, the strEnd prompt has the correct date (6/30/15) but the very next line shows 7/1/15
I'm not sure why it's doing that. Any help would be appreciated.
thanks
lhuffst
Code:
'default dates - find out what is common
dteStart = Format("1/1/" & DatePart("yyyy", Date), "mm/dd/yyyy")
dteEnd = Format("12/31/" & DatePart("yyyy", Date), "mm/dd/yyyy")
' get the date range they want to use
strStart = InputBox("Enter Start Date Range:", "Start Date", dteStart)
If IsDate(strStart) Then dteStart = strStart
strEnd = InputBox("Enter End Date Range:", "End Date", Format(dteEnd, "mm/dd/yyyy"))
[COLOR=#CC0000][b]If IsDate(strEnd) Then dteEnd = strEnd[/b] line that translates wrong[/color]
strStart = DateAdd("d", -1, dteStart)
strEnd = DateAdd("d", 1, dteEnd)
' Me.Filter = [EffectiveDate] or [RetireDate] in
' Me.Filter = "((EffectiveDate BETWEEN #" & strStart & "# And #" & strEnd & "#)) AND IsNull(retireDate) " _
'& " Or (retireDate BETWEEN #" & strStart & "# And #" & strEnd & "#)" [COLOR=#A40000]original filter [/color]
Me.Filter = "((EffectiveDate Or RetireDate BETWEEN #" & strStart & "# And #" & strEnd & "#)) " [COLOR=#729FCF]Filter I just tried[/color]
I'm running the report from 4/1/15 to 6/30/15
The problem I"m having is the effective date column is showing 7/1/15 (based on the date passed)
when I step through the code, the strEnd prompt has the correct date (6/30/15) but the very next line shows 7/1/15
I'm not sure why it's doing that. Any help would be appreciated.
thanks
lhuffst