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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List box problem, Please help me out!

Status
Not open for further replies.

manosubbiah

Programmer
Jan 2, 2001
8
IN
Hai,
I am new to vfp programming.
My code follows,
thisform.list1.columncount = 3
thisform.list1.rowsource = "select short, name, no from customer"
thisform.list1.rowsourcetype = 3

Now the list box is populated with these values.
When I select a record from the listbox, how will i get the Short, Name and No from the Listbox? What is the property i have to use to get the field values i have selected. I am fed up with this problem. Please help me out to fix it asap.

I have another problem also, suppose i need to insert tab between 2 string values, how can i give?
Thanx for any help in advance.
Mano
 
Hi!

First of all, add 'into CursorName' o the select statement you used for combobox, itherwise you will get browse window when that query runs.

You can get values using following syntax:

if ListObject.ListIndex>0 && if something selected
ListObject.List[ListObject.ListIndex,ColumnNumber]
endif



Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Vlad,

I'm a bit confused. Where does the snipped of code you list go?
Code:
if ListObject.ListIndex>0 && if something selected
  ListObject.List[ListObject.ListIndex,ColumnNumber]
endif
If it's in the click event of ListObject, doesn't the "if" have to be true? And if it's elsewhere, don't you need to assign the result to some variable? -- Dave
 
Hi!

It is just a sample code.
ListIndex might be 0 in some cases though event fired.
Yes, I just made an expression variable reference. You can use it either to get a value or alter the item in list by assigning to it some string.


Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top