|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How To Filter A Report From A Pop-up Form
Hi
I have followed the instructions shown on the web page below on an example page & I have managed to get it working. I have used the same technique with my database with 21 combo boxes instead of 5 on a pop-up form in front of a report. I have named each combo box Filter1, Filter2, Filter3 etc… I can select values in any of my combo boxes, my report property is set to “Filter On” however when I click on the Set Filter Button it shows an error message “Microsoft Access cannot find Filter(1,2,3 or which every filter i click on) contained in your expression” There is some error or text missing within the set filter Command button expression. How can I ensure all of my combo boxes are included in my SQL expression? The SQL Script is shown below is what i have copied. The text highlighted in red is what the debug program highlights. Private Sub Set_Filter_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![rptCustomers].Filter = strSQL Reports![rptCustomers].FilterOn = True End If End Sub http://support.microsoft.com/?kbid=208529 Any Help would be most appriciated. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > How To Filter A Report From A Pop-up Form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|