Split For Filter Problem (1 Viewer)

theDBguy

I’m here to help
Staff member
Local time
Today, 15:28
Joined
Oct 29, 2018
Messages
21,454
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

  • test4.zip
    141.1 KB · Views: 186
Last edited:

JustinS

Member
Local time
Today, 18:28
Joined
Apr 11, 2020
Messages
58
Yes, my code matches what you put. Is there something other than the AddFilter procedure that is being done to make the filters work?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:28
Joined
Oct 29, 2018
Messages
21,454
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.
 

JustinS

Member
Local time
Today, 18:28
Joined
Apr 11, 2020
Messages
58
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:28
Joined
Oct 29, 2018
Messages
21,454
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.
 

JustinS

Member
Local time
Today, 18:28
Joined
Apr 11, 2020
Messages
58
@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

  • TempVars Issue.pdf
    32.8 KB · Views: 168

theDBguy

I’m here to help
Staff member
Local time
Today, 15:28
Joined
Oct 29, 2018
Messages
21,454
@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.
 

JustinS

Member
Local time
Today, 18:28
Joined
Apr 11, 2020
Messages
58
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:

theDBguy

I’m here to help
Staff member
Local time
Today, 15:28
Joined
Oct 29, 2018
Messages
21,454
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...
 

JustinS

Member
Local time
Today, 18:28
Joined
Apr 11, 2020
Messages
58
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:28
Joined
Oct 29, 2018
Messages
21,454
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
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 17:28
Joined
Feb 28, 2001
Messages
27,147
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.
 

JustinS

Member
Local time
Today, 18:28
Joined
Apr 11, 2020
Messages
58
@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

Top Bottom