Open Report with the parameter

  • Thread starter Forms is loaded function
  • Start date
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"
 

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