|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi guys,
I need to set up a filter from a from with 4 different combo box. I name the combox boxes Filter1, Filter2 and so on. I'd like to be able to filter one by one and all then together, just like the way you filter on an excel sheet. Here is the code that I'm having problem with Dim strSQL As String, intCounter As Integer 'Build SQL string For intCounter = 1 To 4 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![rpt_FIELDREP_MASTER].Filter = strSQL Reports![rpt_FIELDREP_MASTER].FilterOn = True the strSQL variable is giving me a mismatch error. Can anyone one help me pleaseee....!!!! A lot of thanks in Advance...!!! Loui, |
|
#2
|
|||
|
|||
|
what values are in the drop down combos? if they are numbers then you might be gettinga mismatch error as you are trying to put a number (from the combo) into the strSQL variable which is a string. Try converting the combo value to a string by using the CStr() function i.e. CStr(me("filter" & intCount) etc etc).
|
|
#3
|
|||
|
|||
|
Hey Mr Jones,
Thanks so much, I'll try this and I let you know. Appreciate your help, I'll get back to you shortly. Loui Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Apply Filter from a combo box to a report |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|