Report Filter ? Clear Filter & Return to Full Report

B

Brook

I have a form to filter a my rptinventory:

everything is working fine, I set my properties and set the filter and the
report filters properly, but what I sould like to do, is on the "Clear"
function it clears my Filter properties, but I would like the clear to also
clear and return the report to original format with no filters?

Any suggestions?

Here is my coding for my frminventorysearch

Begin Code:

Private Sub Command28_Click()

Dim strSQL As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 5
If Me("Filter" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " & " =
" & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "
End If
Next

If strSQL <> "" Then
'Strip Last " And "
strSQL = left(strSQL, (Len(strSQL) - 5))
'Set the Filter property
Reports![rptInventory].Filter = strSQL
Reports![rptInventory].FilterOn = True
Else
Reports![rptInventory].FilterOn = False
End If

End Sub


Private Sub Command29_Click()

Dim intCouter As Integer

For intCouter = 1 To 5
Me("Filter" & intCouter) = ""
Next

End Sub



Private Sub Command30_Click()
DoCmd.Close acForm, Me.Form.Name
End Sub

Private Sub Form_Close()
DoCmd.Close acReport, "rptInventory"
DoCmd.Restore
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenReport "rptInventory", A_PREVIEW
DoCmd.Maximize
End Sub

End Code *****
 

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