MajP
You've got your good things, and you've got mine.
- Local time
- Today, 02:54
- Joined
- May 21, 2018
- Messages
- 9,483
Add these two calculated fields to your query to help with the odd even issue
Example
MinStart <= 123 AND maxEnd >= 123
FYI without adding the calculated field in the query the filter could be done. You street number has to be greater than the Odd_Start OR greater than the Even_Start. And it has to be less than the Odd_End or Less than the Even_End. Which is more complicated than doing the work in the query.
Also that example had nothing to do with street number. That had to do with street names. You could do an FAYT on the name.
Code:
MinStart: IIf([odd_start]<[Even_start],[Odd_start],[Even_start])
MaxEnd: IIf([odd_End]>[Even_End],[Odd_End],[Even_End])
Code:
If Not (Me.txtStNum & "") = "" Then
fltrRange = "MinStart <= " & Me.txtStNum & " AND maxEnd >= " & Me.txtStNum
Debug.Print fltrRange
End If
MinStart <= 123 AND maxEnd >= 123
FYI without adding the calculated field in the query the filter could be done. You street number has to be greater than the Odd_Start OR greater than the Even_Start. And it has to be less than the Odd_End or Less than the Even_End. Which is more complicated than doing the work in the query.
Code:
fltrRange = "(Odd_Start <= " & Me.txtStNum & " OR Even_Start <= " & me.txtStNum & ") AND ODD_END >= " & Me.txtStNum & " OR EVEN_END >= " & Me.TxtStNum & ")"
Also that example had nothing to do with street number. That had to do with street names. You could do an FAYT on the name.
Attachments
Last edited: