I have a number of tables where the codes start well above zero. Invoices for example. I started our Invoice numbers at 100,000 so that all invoices (at least for the first 899,999!) will be six figures when printed. I have seen various Accounting applications where they left pad the Invoice number with zeroes to give a constant length. Personally, when I pay one of these invoices I am never sure whether I should include the zeroes or not in the payment advice. All this to show that there is a case for handling numeric fields which start well above zero. Unfortunately the code in the cWebSuggestionForm.pkg does not do this:
Code:
   Else Begin
      If (eType = DF_BCD and Length(sSearch) < iLength) Begin // sSearch is the search value being passed.  ilength is piStartAtChar which usually starts at 2 or 3 characters.
          //  For numeric fields we'll jump in the index to the next possible value (for example from 40 to 400)
                            
          Move (GetRowID(iFile)) to riTest // This is the RowID of the First Record in the table (in my Invoice example, for code 100,000) 
                            
          // Consider: Runtime expression if sSearch contains something else as a number!  This is DF's comment
          Move (sSearch * 10) to sSearch            // This increments the value of the Search string by one order of magnitude. if the search string was 11 say, it would become 110  
          Set_Field_Value iFile iField to sSearch
          Send Request_Read of hoServer GE iFile iIndex  // Since the search value is 110 and the first record is 100,000 this will find the first record. 
          Move (not(IsSameRowID(riTest, GetRowID(iFile)))) to bcontinue  // This line stops the search because the riTest and the current RowID are the same.  No list can be shown. 
                            
   End
What is needed is a loop to increment sSearch until it is the same order of magnitude as the First record ie: a Search value of "11" should be converted to 110,000 when a new record will be found and the suggestion list created.

I have sub-classed cWebSuggestionForm to cWebSuggestionNum which pre-processes sSearch in the OnFindSuggestion function. However, it would be a simple matter to put a loop in the original package like this.

Code:
    // Consider: Runtime expression if sSearch contains something else as a number!
        While (IsSameRowID(riTest, GetRowID(iFile))) 
           Move (sSearch * 10) to sSearch
           Set_Field_Value iFile iField to sSearch
           Send Request_Read of hoServer GE iFile iIndex
           if (not(Found)) Break 
        Loop
If anyone would like a copy of my cWebSuggestionNum class I would be happy to oblige.
Ian