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!

Selecting on a multi column listbox

Status
Not open for further replies.

admdev

Programmer
May 17, 2006
56
US
Hi all,

I hope somebody can help me with this issue.

I have a form which has a multi column list box. What I want to do is select multiple rows and build a cursor based on the rows selected. For example.

List box contains.
Record ID Customer ID Customer Name
1 1234 Test1
2 2345 Test2
3 3456 Test3

So I want to build a cursor based on these values. I already have the cursor predetermined. I just need to know how to retrieve individual fields from the listbox.

Any help would be appreciated.

Thanks.
 
Hello admdev,

I should suggest an other solution.
Make a grid in stead of a listbox

grid with record id customer-id customer-name and column4 named selection.
in this grid column 4 you fill it up with a checkbox.

In this case you can choose all the rows you select and put in a dbf or cusor file.

wfg,
FILIP MERLIER
 
You can loop through all item in the listbox, and if it's a selected row, use the value of the first column. Something like this:
Code:
SELECT MyTable
FOR zzz = 1 TO thisform.MyListBox.ListCount
   *... if item is selected
   IF thisform.MyListBox.Selected(zzz)
      &&... process this one
      GOTO VAL(thisform.MyListBox.listitem(zzz, 1)) 
      SCATTER MEMVAR
      INSERT INTO MyCursor FROM MEMVAR
   ENDIF 
NEXT

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks to both of you for the reply! I really appreciate it.

DSummZZZ- What you suggested is exactley what I was looking for. I tried it and it's working fine.

Thanks both of you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top