NeilPattison
IS-IT--Management
I have set up a report called rptAbsence, and also a dialog box called frmAbsenceFilter. This dialog box is a form containing a combo box and 2 command buttons (apply and remove). The combo box comes from a table called[Issues].
The problem I'm having is when I apply the filter a box pops up asking for a parameter value for [issue].
The code I have used for the dialog box is below
Private Sub cmdApplyFilter_Click()
Dim strIssue As String
Dim strFilter As String
' Checks that the report is open
If SysCmd(acSysCmdGetObjectState, acReport, "rptAbsence") <> acObjStateOpen Then
MsgBox "You must open the report first."
Exit Sub
End If
' Builds the criteria string for the Issue field
If IsNull(Me.cboIssue.Value) Then
strIssue = "Like '*'"
Else
strIssue = "='" & Me.cboIssue.Value & "'"
End If
strFilter = "[Issue] " & strIssue
' Applies the filter and switchs it on
With Reports![rptAbsence]
.Filter = strFilter
.FilterOn = True
End With
End Sub
----------------------------------------------------------------------
Private Sub cmdRemoveFilter_Click()
On Error Resume Next
Reports![rptAbsence].FilterOn = False
End Sub
Does anyone know why this is occuring and how it can be resolved? Any help would be greatly appreciated
The problem I'm having is when I apply the filter a box pops up asking for a parameter value for [issue].
The code I have used for the dialog box is below
Private Sub cmdApplyFilter_Click()
Dim strIssue As String
Dim strFilter As String
' Checks that the report is open
If SysCmd(acSysCmdGetObjectState, acReport, "rptAbsence") <> acObjStateOpen Then
MsgBox "You must open the report first."
Exit Sub
End If
' Builds the criteria string for the Issue field
If IsNull(Me.cboIssue.Value) Then
strIssue = "Like '*'"
Else
strIssue = "='" & Me.cboIssue.Value & "'"
End If
strFilter = "[Issue] " & strIssue
' Applies the filter and switchs it on
With Reports![rptAbsence]
.Filter = strFilter
.FilterOn = True
End With
End Sub
----------------------------------------------------------------------
Private Sub cmdRemoveFilter_Click()
On Error Resume Next
Reports![rptAbsence].FilterOn = False
End Sub
Does anyone know why this is occuring and how it can be resolved? Any help would be greatly appreciated