Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List box Popup - Changing Available Items in the List
Message
From
25/09/2002 13:46:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
List box Popup - Changing Available Items in the List
Miscellaneous
Thread ID:
00704381
Message ID:
00704381
Views:
64
I have to maintain a FPD26 system that is slowly being converted to VFP7. I have not looked at List Box popups in FPD26 in sometime, so I'm hoping that someone else's memory is better than mine!

The listbox popup has 4 static items in the list (entered in the screen designer). It is using the list box's When function by returning .t. or .f. depending on if the user is editing or not (the value of m.criteria determines this). I need to be able to change the items in the listbox to restrict the user to only 1 or 2 of the static items if the value in another listbox popop (m.pol_repfrm) on the same screen is a certain value. How to do this? In what method of the FPD26 screen do I put the code to change the items in the listbox? I need to change it after the user selects an item in the m.pol_repfrm GET field.

It's been too long since I did this in FPD26! Here is the code from the .spr that creates the listbox and also the listbox that holds the reportform choice (m.pol_repfrm):
* m.pol_repfrm choose a report to print
* this value will affect the options available in the listbox
* for m.whatorder

@ 15,3 GET m.pol_repfrm ;
	PICTURE "@^ Policy Summary;Policy Detail;Profiles-Policy;Profiles-Standard;Profiles-Contract;Mailing Labels;Laser Labels" ;
	SIZE 3,20 ;
	DEFAULT "Policy Summary" ;
	VALID _0rt0zsap0()

* Now here is the screen generated code with the static list items.  I need
* to change it to only 1 or 2 items based on the user's choices in the 
* listbox above (m.pol_repfrm value).

@ 15,25 GET m.whatorder ;
    PICTURE "@^ NAME;POLICY#;EFFECTIVE;EXPIRATION" ;
    SIZE 3,14 ;
    DEFAULT "NAME" ;
    WHEN m.criteria

*m.pol_repfrm's valid event
FUNCTION _0rt0zsap0     &&  m.pol_repfrm VALID
#REGION 1
IF m.pol_repfrm = "Policy Summary"
	pol_group    = '       '
	pol_group(1) = 'COMPANY'
	SHOW GETS
ELSE
	SHOW GETS OFF
ENDIF
.·*´¨)
.·`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"
Next
Reply
Map
View

Click here to load this message in the networking platform