Subform filter question (1 Viewer)

helper11

Registered User.
Local time
Today, 11:04
Joined
Apr 10, 2010
Messages
40
Hi all,

I am trying to filter a subform, I can do a single item per field with no problem. I have one field that has would be as follows:

venue <>"amz" And <>"ali" but I am not sure how to code it, even hard code it. Below is what I have for a single filter coding.

If Not IsNull(Me.Combo3) And Not IsNull(Me.Combo7) Then

strSales = "refund = No AND venue = 'amz' AND expr1 ='" & Me.Combo7 & "' AND MonthName(Expr3) ='" & Me.Combo3 & "'"
Me.Total_Sales.Form.Filter = strSales
Me.Total_Sales.Form.FilterOn = True
End If

As you see above I want to get venue <> 'amz and <>ali' but can't get any combo I tried to work.

All suggestions welcome and appreciated....
 
Last edited:

dkinley

Access Hack by Choice
Local time
Today, 10:04
Joined
Jul 29, 2008
Messages
2,016
strSales = "refund = No AND venue = 'amz' AND expr1 ='" & Me.Combo7 & "' AND MonthName(Expr3) ='" & Me.Combo3 & "'"

Hmmm ... how about ...

Code:
strSales = "([refund] = 0) AND ([venue] = 'amz' ) AND ([expr1] = '" & Me.Combo7 & "') AND ([MonthName(Expr3)] = '" & Me.Combo3 & "'"

Now, I am not sure if the MonthName(Expr3) is or what it is. I don't put parenthis in field names so unsure what you have going on there or anything.

All I tried to was group accordingly to how I normally create filter strings but unsure of your data types, for instance using a 0 if refund is a yes/no field, etc.

HTH,
-dK
 

Users who are viewing this thread

Top Bottom