Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox rowsource of substr
Message
De
15/01/2004 09:25:57
 
 
À
15/01/2004 07:57:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00866897
Message ID:
00867084
Vues:
23
Thanks Cetin,

If I had more time I would have switched to a grid, but the idea is that the user will scroll through the results, press on the item in the list (record) that they want to view and be taken to that record and the form releases. There are four textboxes for searching on the form and the listbox returns the results. A query is now done (SELECT SQL) in the lostfocus of each textbox that pulls the appropriate records and then the listbox is populated with the results. I may change it to a grid later.


>>I am converting a FPD26 screen that used to popup a browse window in DOS. I have created a listbox to hold the values on the form but the problem I am running into is how to get the listbox to recognize the values. Right now it stuffs the columns using SUBSTR() with the entire contents of the field de_data. Here is my new code:
>>
>>
>>thisform.list1.rowsource = substr(master.de_data,62,20), substr(de_data,2,25), de_profile
>>
>>two of the colums are a substr of the field. I have tried using a rowsourcetype of 6 - fields to no avail. Anyway to do this?
>>
>>Here is the original FPD26 code:
>>
>>BROWSE FIELDS ;
>>	x2 = substr(de_data,62,20) :H="License#", ;
>>	x1 = substr(de_data,2,25) :H="Name", ;
>>	x3 = de_profile :H="System ID" ;
>>	FREEZE x2 ;
>>
>>
>>TIA!
>>Tracy
>
>Tracy,
>A grid is always the (better?) alternative to a listbox :)
>For listbox FWIW I'd use rowsourcetype = 3 && SQL. ie :
>
>
>with thisform.myListBox
> .RowSourceType = 3
> .RowSource = 'select substr(de_data,62,20) as "License",'+;
>              '  substr(de_data,2,25) as "Name",'+;
>              '  de_profile as "SystemID"'+;
>              ' from myTable'+;
>              ' into cursor crsMyCursor'
> .ColumnCount = 3 && Might be 1-3
> .ColumnWidths = "70,80,100"
>endwith
>
Cetin
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform