Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there another solution for movebars in listbox?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Is there another solution for movebars in listbox?
Divers
Thread ID:
00874202
Message ID:
00874202
Vues:
55
I have a form with 2 listboxes. I want to be able to select items in listbox1 and show related information in listbox2. everything works fine, except I need to be able to use listbox2 movebars. I am setting the rowsource=3 and rowsourcetype= my query statement. It seems like I can't use movebars except for rowsource=1 or 0. I need to use movebars because whatever order my use moves the items using movebars, is the order I need to resave that information back to the table. My delima is what can I do to use movebars in listbox. Here is what my table looks like
typecnt     typetask    taskorder
=================================
MOU         task1           1
MOU         task2           2
PSP         task1           1
MOU         task3           3
MOU         task4           4
PSP         task2           2
listbox1 will display
MOU
PSP
listbox2 will display following if user selects MOU from lisbox1
MOU   task1  1
MOU   task2  2
MOU   task3  3
MOU   task4  4
After using the movebars in listbox2 I will need resave the new item order
MOU   task4  4
MOU   task2  2
MOU   task1  1
MOU   task3  3
I need to have movebars available in listbox2 and yet have it tied in with selection of listtbox1. Here is how I have tied both listboxes.
*** listbox1
	LOCAL lcRowSource 
		lcRowSource = 'SELECT DISTINCT(ALLTRIM(tct_tc)) FROM tskcnt_tmp_tbl '
		lcRowSource = lcRowSource + 'INTO CURSOR crstc ORDER BY tct_tc'
		.l1.rowsourcetype=3
		.l1.rowsource = lcRowSource
		.l1.requery()
		.l1.listindex=1
		thisform.refresh()
		z = ALLTRIM(.l1.value)

*** listbox2
		lcRowSource = 'SELECT ALLTRIM(tct_task), tct_order FROM tskcnt_tmp_tbl '
		lcRowSource = lcRowSource + 'INTO CURSOR crstctask where tct_tc = (z) ORDER BY tct_order'
		.l2.rowsourcetype=3
		.l2.rowsource = lcRowSource
		.l2.requery()
		.l2.listindex=1				
		.refresh()
is there another solution to this listbox2 without using rowsource=3? Also, is there a quicker way to save the new order items back to orginal table?


thanks
Nick Patel

Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform