Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list box control in VFP 8.0 1

Status
Not open for further replies.

cgc22

Programmer
Jan 17, 2007
10
US
Hi I have a customer.dbf file with a list of all my customers. I want to be able to display a list of customer
to the screen but I want the "list" to start where the "user" inputs 1-6 letters and the list displays at the
point the user designates. I created a form with a textbox
and list box. I got the text box to open the .dbf file to the record I want by using the following code:
USE CUSLIST ALIAS CUSLIST
SET INDEX TO COMPANY.IDX
CONAME = SPACE(LEN(LEFT(CL_COMPANY,1))) ?? set up variable
SEEK LEFT(CONAME,1) ??to get to the record I want
The Textbox procedure works great but the problem is that the list box always displays at top of .dbf file and it disregards where the textbox found the proper record. How can I "bind" the textbox to the list box?? Or maby I need to do something else like using a Query Form. Please Help
Thanks Greg
 
No need for bindings of any sort. Just set the Value of the listbox equal to the value of the textbox. Perhaps put this code in the textbox LostFocus:

[TT]thisform.listbox.Value = this.Value[/TT]

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top