• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What is wrong with my statement?

Megadeth

Senior member
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") & "'"
 
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.
 
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") & "'")
 
Back
Top