PDA

View Full Version : SQl VBA Access 2007 -filter not working properly



satyen
03-03-2011, 02:23 PM
Hello

Was wondering if someone could help.

I have recently upgraded to Access 2007. The code for the filter does no longer work correctly as the filter options have changed- there are more options in fact. There is a total field which shows the total. it works for 4 filters but after the the filter filter is placed it stops working. The sql query is extending and there are some brackets that need to be there to encapsulate the OR's. please can someone help

The code is connected to a form




If Me.filter On then

twhere = Replace(Me.Filter, "[frm_Contact]", "c.")
twhere = Replace(twhere, "(, "")
twhere = Replace(twhere, "), "")
twhere = Replace(twhere, "#", "'")
twhere = Replace(twhere, """", "'")
t_sql= t_sql & "where " & t_sql & " and c.match=0"
Else