Form Filter? "Enter Parameter Value"

G

Guest

I have a form filter that I use to filter a report on the fly.

I can enter my search criteria (7 combobox's), the Filter is based on my
rptinventory, which in turn is based on my qryinventory.

When I enter a filter criteria in my combobox and click the apply filter
button, I get a message box:

"Enter Parameter Value"
I'm not sure what to put here, so I click ok and my report is blank ? Any
ideas?

Below I am pasting code:

on Form Open & Close:
***** Code begin
Private Sub Form_Close()
DoCmd.Close acReport, "rptcompleteinventory"
DoCmd.Restore
End Sub

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

***** Code End

on Clear Filter cmdbutton:

***** Code begin
Private Sub clearfilter_Click()
Dim intCouter As Integer

For intCouter = 1 To 7
Me("Filter" & intCouter) = ""
Next
End Sub

***** Code End

On Apply filter cmdbutton:

***** Code Begin
Private Sub applyfilter_Click()
Dim strSQL As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 7
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![rptcompleteinventory].Filter = strSQL
Reports![rptcompleteinventory].FilterOn = True
Else
Reports![rptcompleteinventory].FilterOn = False
End If
End Sub


***** Code End


Thanks for any tips ... suggestions?

Brook
 

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