Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor and Listbox
Message
From
10/03/2003 08:36:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/03/2003 08:18:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00763569
Message ID:
00763575
Views:
30
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>I have a form that contains a combobox, listbox and some text fields. The InterActiveChange Event of the combobox creates a cursor containing addresses based on the selected value of the combobox and then sets the rowsource of the listbox to this cursor. When the user selects one of the addresses in the listbox the text fields are enabled and filled with information specific to the selected address.
>
>The combobox events seem to work fine. The listbox is populated with the right information. However, when I select one of the addresses in the listbox the address reverts back to the address from the previous combobox selection. The weird thing is that the information in the textboxes is the correct information and when I change the focus from the listbox the address changes back to the correct address. Everything works fine until I make another selection from the combobox.
>
>Hope this makes sense! Any suggestions as to what would be causing this would be greatly appreciated.
>
>Thanks in advance,
>Russell

Russell,
What about setting RowSource of listbox to an SQL and requery. ie (sort of):
*Listbox.init
with this
 .RowSourceType = 3
 .RowSource = 'select myDisplayFields,IDField '+;
  ' from myTable'+;
  ' where myField = thisform.ComboName.Value'+;
  ' into cursor crsListBox'
 .ColumnCount = 1 && or more if you want to show multiple columns
* .Columnwidths = ... 
endwith

* Listbox interactivechange
=Seek(crsListbox.IDField,'myAddressTable','IDTag')
thisform.refresh

*Combo interactivechange
with this.parent.listboxname 
 .requery
 .listindex = 0
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
Next
Reply
Map
View

Click here to load this message in the networking platform