OK, I call a report, RSR, from form FISReports.
On the form, you can choose the date range (not optional), a specific individual ("BA", optional), and the status (optoinal) of the projects you want to report on.
The button that runs the report has the following code to filters the optional choices:
The Report itself then uses a query, QSRReport, to pull in the actual data. Here's the query:
The problem I'm up against now is I need to specify on the report what status its for: Open, Closed, or All. Now, if the report is open or closed, specifically, I can populate the text field I'm using as a title w/ "Open" or "Closed" based on one of the fields that's being pulled in. No problem.
The remaining issue is that I can't figure out how to get it to populate "All". The code selects "All" based on the user NOT populating the status field. So, on the report end, there's nothing for me to key on to say label the report "All."
I hope this is enough to get going on. I'm sure there's some obvious way to do this, I just haven't had my "duh" moment yet.
If I can provide more info, please say so.
Thanks for whatever help anyone can provide.
On the form, you can choose the date range (not optional), a specific individual ("BA", optional), and the status (optoinal) of the projects you want to report on.
The button that runs the report has the following code to filters the optional choices:
Private Sub RunRepSRnon_Click()
On Error GoTo Err_RunRepSRnon_Click
Dim stDocName As String, stDocWhere As String
stDocName = "RSR"
If Not IsNull(Forms![FISReports].BA) And Not IsNull(Forms![FISReports].Status) Then
stDocWhere = "([Status].TOpCl) = '" & Me.Status & "' And[BA] = '" & Me.BA & "'"
ElseIf Not IsNull(Forms![FISReports].BA) Then
stDocWhere = "[BA] = '" & Me.BA & "'"
ElseIf Not IsNull(Forms![FISReports].Status) Then
stDocWhere = "([Status].TOpCl) = '" & Me.Status & "'"
End If
DoCmd.OpenReport stDocName, acPreview, , stDocWhere
Exit_RunRepSRnon_Click:
Exit Sub
Err_RunRepSRnon_Click:
MsgBox Err.Description
Resume Exit_RunRepSRnon_Click
The Report itself then uses a query, QSRReport, to pull in the actual data. Here's the query:
SELECT Status.TOpCl, SR.BA, SRComment.Comment, SRComment.Date, SR.Product, SR.Releasenum, SR.ProjectSR, SR.SRNum, Status.TOpCl, SR.SRTitle, SR.SRDescription, SR.SRType, SR.CurStat, SR.Requestor, SR.DepRequesting, SR.DtSubmitted, SR.DtResolved, SR.RqStdCompDt
FROM Status INNER JOIN (SR INNER JOIN SRComment ON SR.SRNum = SRComment.SRNumb) ON Status.Status = SR.CurStat
WHERE (((SRComment.Date) Between [Forms]![FISReports]![From Date] And [Forms]![FISReports]![To Date]) AND ((SR.SRType)<>"Project" Or (SR.SRType) Is Null));
The problem I'm up against now is I need to specify on the report what status its for: Open, Closed, or All. Now, if the report is open or closed, specifically, I can populate the text field I'm using as a title w/ "Open" or "Closed" based on one of the fields that's being pulled in. No problem.
The remaining issue is that I can't figure out how to get it to populate "All". The code selects "All" based on the user NOT populating the status field. So, on the report end, there's nothing for me to key on to say label the report "All."
I hope this is enough to get going on. I'm sure there's some obvious way to do this, I just haven't had my "duh" moment yet.
If I can provide more info, please say so.
Thanks for whatever help anyone can provide.