Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brook - 21 Apr 2005 01:21 GMT
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
Graham Mandeno - 21 Apr 2005 11:47 GMT
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.
Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

>I have a form filter that I use to filter a report on the fly.
>
[quoted text clipped - 66 lines]
>
> Brook
Brook - 21 Apr 2005 14:18 GMT
That is what is confusing me... it doesn't give me a name.. its blank..

Brook

> Hi Brook
>
[quoted text clipped - 72 lines]
> >
> > Brook
Graham Mandeno - 22 Apr 2005 00:24 GMT
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.
Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

> That is what is confusing me... it doesn't give me a name.. its blank..
>
[quoted text clipped - 82 lines]
>> >
>> > Brook
Brook - 22 Apr 2005 01:15 GMT
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

> Hi Brook
>
[quoted text clipped - 88 lines]
> >> >
> >> > Brook
Graham Mandeno - 22 Apr 2005 01:24 GMT
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 "

Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

>I will take a look at that and let you know...
>
[quoted text clipped - 99 lines]
>> >> >
>> >> > Brook
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.