Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo - Listbox
Message
From
25/11/2001 14:57:31
 
 
To
25/11/2001 08:20:15
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00585457
Message ID:
00585553
Views:
19
Hi Marcia

Thanks for the reply. I'm not sure that this helps. Perhaps I should explain a bit more.

I have two fields (at the moment) on the form for the differents parts of the address (Stno & Street). The Street field has a regular index it. I want to place the following code in the KeyPress method to reduces the items in the dropdown box as the user enters keystrokes:-

LPARAMETERS nKeyCode, nShiftAltCtrl

if between(nKeyCode, 32, 122)

nKeyLen = LEN(this.RowSource)
cKeyRangeStart = PADR((subs(this.text, 1, this.selstart)+;
CHR(nKeyCode)),nKeyLen,' ')
cKeyRangeEnd = PADR((subs(this.text, 1, this.selstart)+;
CHR(nKeyCode)),nKeyLen,'~')
nAliasField=ATC('.',this.RowSource)
IF nAliasField=0
cboAlias=ALLTRIM(this.RowSource)
ELSE
cboAlias=SUBSTR(this.RowSource,1,nAliasField-1)
endif
SET KEY TO RANGE cKeyRangeStart, cKeyRangeEnd IN (cboAlias)
GO top
this.Requery
this.Refresh

nCurPos = this.selstart + 1
IF !EMPTY(this.List(1,2))
this.Value = this.list(1,2)
this.SelStart = nCurPos
this.SelLength = len(allt(this.list(1,2))) - nCurPos
ENDIF

nodefault
endif

The problem is that there may be many addresses in the same street and the user needs to know which one to select. I can place the street number on the right but I would dearly love to have the street number on the left hand side where it more naturally fit. This would enable me to have the same dropdown on multiple fields (eg. Street, Suburb, City) using a combination of filters and key ranges.

Eventually the application will be used over the net and I will alter the above code to require (probably) three charactors of the address before allowing a dropdown thus prventing the entire customer listings going across the net.

Your reply may have given me the answer, I believe. If I add a non-display field at the front (eg. ColumnWidths=0,60,250) and repeat the appropriate field as the first field (RowSource=Cust.Street,Stno,Street).

I have a bit of work to do before I have it working properly so will let you know.

Regards
Geoff Scott
May all your weeds be wildflowers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform