View Full Version : Multi-State Button-Only Partially Working!


03-11-2005, 05:11 PM
I have what seems to me like a really strange problem -- I have a multi-state button similar to the AlphaSports type -- to select records by first letter -- it works perfectly from A through W, but Y and Z do not work (gives messsage "No records found...") even though there are lots of names begining with Ys and Zs in the database. Anyone with an idea what might be the cause of this?

Below is my code for this Multistate button in the OnChange event: (most of this was copied from AplphaSPorts)

dim tbl as P

topparent:tables:individuals.filter_expression = "left("+search3.text+", 1) = '" + mulstbtn1.text + "'"
topparent:tables:individuals.order_expression = search3.text

tbl = table.current()
i = tbl.index_primary_get()
count = i.records_get()

if count = 0
ui_msg_box("Warning", "No records found. Showing all records")
tbl.order(search3.text,search3.text + " "" \"\"")
mulstbtn1.text = "1"
end if

'WES: The following line was added to make a-z sort on Last_Name rather than Ind_ID

'WES: The following line was added to eliminate the problem of "Maximum Number of Indexes"

'WES: Added the following to get the sort to work on "Search3" selection rather than on "Ind_ID"
***********************end code*****************

Tom Cone Jr
03-12-2005, 12:38 AM

Double check the values in the Y and Z multi-state button. Verify that there are no leading or trailing blank spaces.

Double check the names in the Y to Z range, to rule out leading blank spaces.

-- tom

03-12-2005, 03:12 AM
Dobule checked all as suggested -- there were no issues there.

I went directly to the default browse to see what was happening there, and discovered that if I did an 'a/z" sort on the Record_ID (auto-increment) field the Ys and Zs did not show up, but when I did a "z/a" sort they were there.

SO I checked the INDEXES -- where I deleted a couple of Indexes and Rebuilt All Indexes. Now eveything in working fine. So, it had something to do with the indexes but exactly what is still a mystery.