B
BMaerhofer
Hello,
I am trying to program a range of dates to determine which version of the
report that should be pulled. Here is the criteria:
rptINITIALLETTER2 = 6/1/08 and newer based from when First Letter was sent
rptINITIALLETTER1 = 5/31/08 through 12/5/06
rptINITIALLETTER = Any others before 12/5/06 or by record number
I have the code listed below. Letter 2 seems to be working properly, it is
just the other two that keep causing me trouble. I keep changing the order
of the code for the date range to try to fix it and it causes either letter
or letter1 to work, but not both together. So I just need to get the range
set correctly and it should work.
(<= #12/5/2006# > #5/31/2008#) - Changed this around quite a bit to try to
get it to work correctly. Please Help!
------------------------------------------------------------------------------------------------
If dtFirstLetter.Value > #6/1/2008# Then
strCriteria = "[Record ID] = " & intID.Value
Select Case modMatch.intLetter
Case 1
DoCmd.OpenReport "rptINITIALLETTER2", acViewPreview,
"qryInitialLetter", strCriteria
Case 2
DoCmd.OpenReport "rptINITIALLETTER2", acViewPreview,
"qryInitialLetterDEERS", strCriteria
End Select
ElseIf dtFirstLetter.Value <= #12/5/2006# > #5/31/2008# Then
strCriteria = "[Record ID] = " & intID.Value
Select Case modMatch.intLetter
Case 1
DoCmd.OpenReport "rptINITIALLETTER1", acViewPreview,
"qryInitialLetter", strCriteria
Case 2
DoCmd.OpenReport "rptINITIALLETTER1", acViewPreview,
"qryInitialLetterDEERS", strCriteria
End Select
Else
If NLET.Value = False Then
strCriteria = "[Record ID] = " & intID.Value
Select Case modMatch.intLetter
Case 1
DoCmd.OpenReport "rptINITIALLETTER", acViewPreview,
"qryInitialLetter", strCriteria
Case 2
DoCmd.OpenReport "rptINITIALLETTER", acViewPreview,
"qryInitialLetterDEERS", strCriteria
End Select
Else
THANKS!!!!
I am trying to program a range of dates to determine which version of the
report that should be pulled. Here is the criteria:
rptINITIALLETTER2 = 6/1/08 and newer based from when First Letter was sent
rptINITIALLETTER1 = 5/31/08 through 12/5/06
rptINITIALLETTER = Any others before 12/5/06 or by record number
I have the code listed below. Letter 2 seems to be working properly, it is
just the other two that keep causing me trouble. I keep changing the order
of the code for the date range to try to fix it and it causes either letter
or letter1 to work, but not both together. So I just need to get the range
set correctly and it should work.
(<= #12/5/2006# > #5/31/2008#) - Changed this around quite a bit to try to
get it to work correctly. Please Help!
------------------------------------------------------------------------------------------------
If dtFirstLetter.Value > #6/1/2008# Then
strCriteria = "[Record ID] = " & intID.Value
Select Case modMatch.intLetter
Case 1
DoCmd.OpenReport "rptINITIALLETTER2", acViewPreview,
"qryInitialLetter", strCriteria
Case 2
DoCmd.OpenReport "rptINITIALLETTER2", acViewPreview,
"qryInitialLetterDEERS", strCriteria
End Select
ElseIf dtFirstLetter.Value <= #12/5/2006# > #5/31/2008# Then
strCriteria = "[Record ID] = " & intID.Value
Select Case modMatch.intLetter
Case 1
DoCmd.OpenReport "rptINITIALLETTER1", acViewPreview,
"qryInitialLetter", strCriteria
Case 2
DoCmd.OpenReport "rptINITIALLETTER1", acViewPreview,
"qryInitialLetterDEERS", strCriteria
End Select
Else
If NLET.Value = False Then
strCriteria = "[Record ID] = " & intID.Value
Select Case modMatch.intLetter
Case 1
DoCmd.OpenReport "rptINITIALLETTER", acViewPreview,
"qryInitialLetter", strCriteria
Case 2
DoCmd.OpenReport "rptINITIALLETTER", acViewPreview,
"qryInitialLetterDEERS", strCriteria
End Select
Else
THANKS!!!!