What is wrong with my statement?

Megadeth

Senior member
Jun 14, 2004
499
0
0
I'm connecting to Call Accounting database and attempting to create a front end for it. I have a front end in Access, but I'm using this opportunity to attempt some .NET programming.

The current issue I am having is with filtering. I can filter based on one source but when I attempt to use multiple sources in my filter it doesn't do anything.


Me.Callacct2BindingSource.Filter = ("trunk = '" & Me.Field2TextBox.Text & "'") And ("date = '" & Me.DateTimePicker1.Value.ToString("MM/dd") & "'")

*EDIT*

I was playing with some ideas and got it.

Me.Callacct2BindingSource.Filter = "trunk = '" & Me.Field2TextBox.Text & "'" & " and date = '" & Me.DateTimePicker1.Value.ToString("MM/dd") & "'"
 

Bulldog13

Golden Member
Jul 18, 2002
1,655
1
81
semicolon instead of AND, I think

EDIT:NM I was thinking objectdatsource filterexpressions
 

Megadeth

Senior member
Jun 14, 2004
499
0
0
it's crazy, it doesn't do anything... I can continue to use the program and use the other filters. If I try to use the problem filter, not only does nothing happen but code that appears after it in the sub does not execute. I put a message box code in afterward and it never happens. If I put the message box code in above the problem code the message box happens but I'm still left without filtering.
 

SearchMaster

Diamond Member
Jun 6, 2002
7,791
114
106
Your AND is outside the quotes, so you have turned it into a boolean expression, basically making it say .Filter = False.

Try this instead:
Me.Callacct2BindingSource.Filter = ("trunk = '" & Me.Field2TextBox.Text & "') And (date = '" & Me.DateTimePicker1.Value.ToString("MM/dd") & "'")