Form Filter... "Enter Parameter Value" ??

B

Brook

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
 
G

Graham Mandeno

Hi Brook

What is the name of the parameter being asked for? That will give a clue.

My guess is that one of your combo boxes has a tag value which doesn't match
the name of the corresponding field to filter.
 
B

Brook

That is what is confusing me... it doesn't give me a name.. its blank..

Brook

Graham Mandeno said:
Hi Brook

What is the name of the parameter being asked for? That will give a clue.

My guess is that one of your combo boxes has a tag value which doesn't match
the name of the corresponding field to filter.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brook said:
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
 
G

Graham Mandeno

Hi Brook

Are you sure that each of your FilterX comboboxes has its Tag property set
to the name of the corresponding field to filter on?

It sounds like at least one of the Tag properties is blank.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brook said:
That is what is confusing me... it doesn't give me a name.. its blank..

Brook

Graham Mandeno said:
Hi Brook

What is the name of the parameter being asked for? That will give a
clue.

My guess is that one of your combo boxes has a tag value which doesn't
match
the name of the corresponding field to filter.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brook said:
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
 
B

Brook

I will take a look at that and let you know...

I am new to creating form filters, and I was unaware of the "Tag" option
within the properties.

Brook

Graham Mandeno said:
Hi Brook

Are you sure that each of your FilterX comboboxes has its Tag property set
to the name of the corresponding field to filter on?

It sounds like at least one of the Tag properties is blank.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brook said:
That is what is confusing me... it doesn't give me a name.. its blank..

Brook

Graham Mandeno said:
Hi Brook

What is the name of the parameter being asked for? That will give a
clue.

My guess is that one of your combo boxes has a tag value which doesn't
match
the name of the corresponding field to filter.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

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
 
G

Graham Mandeno

The Tag property has nothing to do with filters, per se. It is just a
property that you can use for a user-defined purpose.

It just so happens that your code is expecting the Tag property of each
combo box to contain the name of the corresponding field:

strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " _
& " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brook said:
I will take a look at that and let you know...

I am new to creating form filters, and I was unaware of the "Tag" option
within the properties.

Brook

Graham Mandeno said:
Hi Brook

Are you sure that each of your FilterX comboboxes has its Tag property
set
to the name of the corresponding field to filter on?

It sounds like at least one of the Tag properties is blank.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brook said:
That is what is confusing me... it doesn't give me a name.. its blank..

Brook

:

Hi Brook

What is the name of the parameter being asked for? That will give a
clue.

My guess is that one of your combo boxes has a tag value which doesn't
match
the name of the corresponding field to filter.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

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