>>>>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
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))"
.refresh
.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 "
.refresh
.columncount=12
endwith
ENDIF
"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."