F
Forms is loaded function
Dim strReport As String
Dim strDateField As String
Dim startDate As String
Dim endDate As String
Dim strWhere As String
Dim lngView As Long
Const strcJetDate = "\#mm\/dd\/yyyy\#"
Select Case Me!ReportToPrint
Case 3
If IsNull(Forms![Reports Dialog]!SelectCategory) Then
DoCmd.OpenReport "Category Reports", PrintMode
Else
If SelectCategory.ListIndex = 0 Then
startDate = Date - 2
MsgBox startDate
endDate = Date
End If
MsgBox strDateField
strWhere = "(" & strDateField & " < " & Format(startDate,
strcJetDate) & ")"
strWhere = strWhere & "(" & strDateField & " < " & endDate & ")"
Debug.Print strWhere
DoCmd.OpenReport "Category Reports", PrintMode, , strWhere
End If
End Select
DoCmd.Close acForm, "Reports Dialog"
Dim strDateField As String
Dim startDate As String
Dim endDate As String
Dim strWhere As String
Dim lngView As Long
Const strcJetDate = "\#mm\/dd\/yyyy\#"
Select Case Me!ReportToPrint
Case 3
If IsNull(Forms![Reports Dialog]!SelectCategory) Then
DoCmd.OpenReport "Category Reports", PrintMode
Else
If SelectCategory.ListIndex = 0 Then
startDate = Date - 2
MsgBox startDate
endDate = Date
End If
MsgBox strDateField
strWhere = "(" & strDateField & " < " & Format(startDate,
strcJetDate) & ")"
strWhere = strWhere & "(" & strDateField & " < " & endDate & ")"
Debug.Print strWhere
DoCmd.OpenReport "Category Reports", PrintMode, , strWhere
End If
End Select
DoCmd.Close acForm, "Reports Dialog"