Newbies gridd Posted October 7, 2002 Newbies Posted October 7, 2002 I am hoping someone can help me and that I can make some sense. I am trying to create a script that will do finds based on a range of numbers. Basically, if the record is part of group 13. I need it to find all records in groups 1-15. If it part of group 23, i need it to find all records in groups 16-30, and so on. I tried an If function like so- If (1 < House Number < 15) then go into find mode, paste 1...15 in house number, perform find, then I have else, If 16<House Number<30, go into find mode, etc, etc. (And I'm using greater than or equal to, not just greater than) The problem seems to be in the if functions because everything else seems to work ok. How do I structure the If function to determine what group of numbers the entry falls into???
falkaholic Posted October 7, 2002 Posted October 7, 2002 Your on the right track. Just don't use paste in find mode. Use the Insert Calculated Result [ "1..13"] then preform the find, see if that works better.
falkaholic Posted October 7, 2002 Posted October 7, 2002 .... and one more thing. with the if logic. Try something like this if ( (houseNumber > 1) and ( houseNumber < 13) )
kennedy Posted October 7, 2002 Posted October 7, 2002 Once you're using the "insert" commands properly, you'll have it working. But here's another suggestion... assuming you may have large numbers of records, coding an "if" test for every range of 15 will get tedious and slow. And then if you ever change to groups of 20, you'll have tons of work to do. Instead, use a little math... SetNumber = Int(MyNumber / 15) FindRange = NumToText((SetNumber * 15) + 1) & "..." & NumToText((SetNumber+1)*15) Then Insert FindRange into the appropriate field in Find Mode. HTH.
Recommended Posts
This topic is 8087 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now