Split For Filter Problem

I hate to continue bothering you, but I cant seem to get the other filters to work. I just extended your select case and it they don't work. Is there something that I am missing. I really want to understand how this done so that I can apply it my real database. I'm attaching the changes that I have made.

I appreciate your patience and help.
I haven't looked at your file yet, but did you do it this way?

PS. I only added the second one (STBY). I'll let you add the third one (TE).
 

Attachments

Last edited:
Yes, my code matches what you put. Is there something other than the AddFilter procedure that is being done to make the filters work?
 
Yes, my code matches what you put. Is there something other than the AddFilter procedure that is being done to make the filters work?
Hi. Yes, I took a look at your code, and you're missing the call to the sub. You need to call the procedure in your buttons.
 
That was it. It think I have a better understanding of what you were doing too. I didn't catch that you added the procedure to the buttons. Thanks
 
That was it. It think I have a better understanding of what you were doing too. I didn't catch that you added the procedure to the buttons. Thanks
Glad to hear that made sense. Good luck with your project.
 
@theDBguy Thanks for helping me on this problem. This working great except for when I move the value of the filter control textbox beyond 4 or -4 and then manually move it back to 0. When the textbox appears to equal 0 it is actually equal to 3.46944695195361E-18 or -3.46944695195361E-18. I am including a pdg with a screenshot of the immediate window of me running through this filter.

The code for the TempVars code is :
Code:
TempVars("Capacity") = "1=1"

Select Case Me.Capacity_Tol
    Case 0 'show all
        TempVars("Capacity") = "1=1"
    Case Is < 0
        TempVars("Capacity") = "[C Difference]<" & Me.Capacity_Tol
    Case Is > 0
        TempVars("Capacity") = "[C Difference]>" & Me.Capacity_Tol
End Select



Have you ever seen this?
 

Attachments

@theDBguy Thanks for helping me on this problem. This working great except for when I move the value of the filter control textbox beyond 4 or -4 and then manually move it back to 0. When the textbox appears to equal 0 it is actually equal to 3.46944695195361E-18 or -3.46944695195361E-18. I am including a pdg with a screenshot of the immediate window of me running through this filter.

The code for the TempVars code is :
Code:
TempVars("Capacity") = "1=1"

Select Case Me.Capacity_Tol
    Case 0 'show all
        TempVars("Capacity") = "1=1"
    Case Is < 0
        TempVars("Capacity") = "[C Difference]<" & Me.Capacity_Tol
    Case Is > 0
        TempVars("Capacity") = "[C Difference]>" & Me.Capacity_Tol
End Select



Have you ever seen this?
Hi. I'm not sure what you did. I don't get the same issue when I tried going pass 4 and then manually going back to 0 with the last demo I posted.
 
I just opened up the last version on this thread and it did it again. All that I am doing is clicking the arrow buttons. I'm using Office 365. Could it be a a software version difference between you and I?
 
Last edited:
I just opened up the last version on this thread and it did it again. All that I am doing is clicking the arrow buttons. I'm using Office 365. Could it be a a software version difference between you and I?
Not sure how you could have used the last version I posted because you can't "manually" reset the value to a zero (0). I had to "unlock" it for me to do what you said you were doing. So...
 
I'm talking about manually moving the textbox value with the arrow buttons, not typing in the value. I know I had the textboxes locked from typing in values.
 
I'm talking about manually moving the textbox value with the arrow buttons, not typing in the value. I know I had the textboxes locked from typing in values.
Ah, okay, that makes sense. In that case, try changing your up and down arrow code as follows:
Code:
Private Sub cmdCapacityAdd_Click()
Capacity_Tol = Round(Capacity_Tol + 0.01, 2)
Me.Requery
AddFilter

End Sub

Private Sub cmdCapacitySubtract_Click()
Capacity_Tol = Round(Capacity_Tol - 0.01, 2)
Me.Requery
AddFilter

End Sub
 
I'll amplify theDBguy's comments JUST A LITTLE. He says it is problematic to work in decimal values.

This is because decimal fractions, with rare exceptions, do not come out even when converted to binary fractions. The simple fraction 0.10 is actually a repeating binary fraction. If you converted it, 0.10 (decimal) is 0.0001100110011001100...001100.. (binary). Because 1/10=1/2*1/5 and 1/5 isn't an even number.
 
@The_Doc_Man thanks for the explanation. I see now it is important to specify the number of decimal places to display. Thank you for your input.
 

Users who are viewing this thread

Back
Top Bottom