Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox has no value
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01372741
Message ID:
01372882
Views:
18
>>>>>>When I chg the rowsource in a listbox, "this.value" proves to be null but gave a legit nbr b4 I chg the rowsource.
>>>>>>How could I get around this?
>>>>>
>>>>>If you want to change rowsource in the listbox first assign it to the empty string, then reset the RowSource.
>>>>
>>>>Such as rowsource="" ?
>>>
>>>Yes. Set it to '', then to your new alias, then requery()
>>
>>
>>
>>Very strange I have 7 choices in an optgrp and here are the last 2. Choice 7 goes wrong for some reason and the value becomes some crazy char. causing my prg to go haywire. It's actually when I select a diff option it happens.Below is code from textbox.
>>
>>
>>thisform.mylistbox1.rowsource=""
>>*thisform.mylistbox1.Requery && Remove this line
>>
>>IF (thisform.optiongroup2.Value)=6
>>with thisform.mylistbox1
>> .rowsourcetype=3
>>.rowsource="select ztype,account,custodian,noun,mhu_loc,model,s_n,location,barcode,req_date,p_u_date,drmo_date,errc,nsn,rek from workfile into curs zadpe where UPPER(ALLTRIM(thisform.text2.Value)) $ UPPER(ALLTRIM(account))"
>> .Requery()
>> .columncount=12
>>ENDWITH
>>ENDIF
>>
>>
>>*here release any "where clause" and show all the records
>>
>>IF (thisform.optiongroup2.Value)=7
>>with thisform.mylistbox1
>> .rowsourcetype=3
>> .rowsource="select ztype,account,custodian,noun,mhu_loc,model,s_n,location,barcode,req_date,p_u_date,drmo_date,rek;
>> from workfile into curs zadpe "
>> .requery()
>> .columncount=12
>>endwith
>>ENDIF
>
>See some changes inside

It seems to be functioning properly now, I made a chg u suggested, quit VFP and restarted. Thanks.
PS, I nominated your name for the Personalities of the year News [January 1, 2009 20:00]
:)
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform