Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List Box Selections
Message
From
05/06/2003 06:21:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00796533
Message ID:
00796553
Views:
10
>Morning,
>
>I have text box which when I enter a number it searches a table and shows the resulting records within a list box. When I select the record in a list box and click a button I want to show that record in another listbox.
>
>Can anybody help me please?
>
>Thanks

Neil,
Saying again :
*ListBox1.Init code 
with this
 .RowSourceType = 3 && SQL
 .RowSource = 'select anyfieldsyouwant,numberMatchField,PrimaryKey'+;
    ' from YourTable'+;
    ' where numberMatchField = thisform.txtUserEntered.Value'+;
    ' into cursor crsList1'
 .ColumnCount = 1-To-AsManyAsYouWantToShowFromSQLSelected
 .ColumnWidths = '50,100,...' && AsManyAsShown
endwith

*ListBox2.Init code 
with this
 .RowSourceType = 3 && SQL
 .RowSource = 'select anyfieldsyouwant,PrimaryKey'+;
    ' from YourTable'+;
    ' where PrimaryKey = crsList1.PrimaryKey'+;
    ' into cursor crsList2'
 .ColumnCount = 1-To-AsManyAsYouWantToShowFromSQLSelected
 .ColumnWidths = '50,100,...' && AsManyAsShown
endwith

*txtUserEntered InterActiveChange or LostFocus or Valid
with thisform.ListBox1
 .Requery()
 .ListIndex = 0
endwith

*ListBox1.click or CommandButton.Click
with thisform.ListBox2
 .Requery()
 .ListIndex = 1
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform