Subject Re: [IBO] LookupCombo doesn't position correctly if values contain numbers
Author Helen Borrie
At 11:14 AM 14/04/2005 -0400, Michael Horne wrote:

>Hello,
>
>I have setup a TIB_LookupCombo to select vendors from
>our vendor file. I have noticed that if the user
>hits "A" for the first letter it doesn't move until
>the second letter is hit. I think this is because
>the first few vendor names in our file start with
>numbers.

No. Numbers in strings are just characters. Alphabetically, they precede
other characters but there's nothing special about them. Your lookup set
is in random order because you are not ordering it. The reason it doesn't
move is because nothing is being done to move it.

Read on....comments inline.


>Examples:
>
>2ND STEEL USED
>5 RIVERS
>AAA COOPER
>ADAMS EQUIP
>
>When first entering the LookupCombo if the user types
>"A" the positioning doesn't change. If they had typed
>"B" then it positions to the first vendor starting with
>"B". I think this might be a bug in the LookupCombo.

Or a lack of reading the help text for the TIB_LookupCombo properties?

You need to set SearchKeyByKey if you want the search to follow a sequence
of one or more keystrokes through the lookup set automatically; otherwise
the user has to type in the whole sequence s/he wants to search for, e.g.
'AAA' and then hit Enter to initiate the search.


>object ibVendor: TIB_LookupCombo
> Left = 88
> Top = 178
> Width = 305
> Height = 21
> Hint = 'Select Vendor'
> DataSource = dsAPVendorLookupEdit
> TabOrder = 8
> AllowTimeout = False
> AutoDropDown = True
> ClearSelectionOnExit = True
> DisplayField = 'APVEN_COMPANY'
> DropDownWidth = -1
> SeekNearest = True

When SeekNearest is true and SearchKeyByKey is false, this causes the first
occurrence of the entered search string to be selected. By default, if the
search string isn't found, the lookup's cursor will stop at the next
nearest value, but it doesn't select it.

> ShowButton = True
>end
>object qyAPVendorLookupEdit: TIB_Query
> DatabaseName = 'C:\Offroad\IB\ORInventory.gdb'
> IB_Connection = formIBData.cnMain
> SQL.Strings = (
> 'select APVEN_COMPANY '
> ' , APVEN_ID'
> ' , APVEN_ADDR1'
> ' , APVEN_ADDR2'
> ' , APVEN_CITY'
> ' , APVEN_STATE'
> ' , APVEN_ZIP'
> ' , APVEN_PHONE'
> 'from apVendor')

Lookups are generally more effective if you order the lookup set by the
KeyDescLinks value, i.e. ORDER BY APVEN_COMPANY.

> KeyLinks.Strings = (
> 'APVendor.APVen_ID=Inv.Inv_SRR_APVen_ID')
> KeyDescLinks.Strings = (
> 'apVendor.APVEN_COMPANY=xAPVEN_COMPANY')
> KeySource = dsInv

Helen