>My class-based form has pages with a list-box on each one. I populate those listboxes with the results of a SELECT. This displays just fine initially. Also, I populate a listbox outside of the pageframe with the results of a SELECT, a dataset from several tables, including the one just created for the afore-mentioned listbox. (I'm sorry, I write fiction, hence the verbosity). The error message appears, and the listbox disappears from the page... neither table created by the SELECTs is not at EOF(). Why do I get a 'Cannot access selected table' and see the listbox disappear? Properties for the shy and prematurely retiring listbox are:
>BoundColumn=2 (text field)
>ColumnCount=2
>DisplayValue=(None)
>RowSource=ABC.PatName,PIDCode
>RowSourceType=6 - Fields
>TablIndex=1
>The rest are height and width and location goodies. The InterActiveChange event has the following:
>LOCAL cCurrCode
>
>SELECT Patient_
>LOCATE FOR PIDCode = ABC.PIDCode
>cCurrCode = PIDCode
>SELECT ABC
>
>WITH THISFORM
> .MakeLists("ABC",cCurrCode)
> .pgf.page1.TxtPIDCode.REFRESH()
> .pgf.page1.TxtSex.REFRESH()
> .LstProcs.REQUERY()
>ENDWITH
>
>Anyone?
>TIA, Robin
Robin,
If I didn't miss it I couldn't see your SQL. But I would bet it's something like :
select .. into cursor ABC
If I'm right that's the problem. You use that cursor as a rowsource and probably "makelists" method is trying to do a reselect into same cursor in interactivechange. It cannot because they're in use by combos. Well I think what I say is not clear. OK here is whatto do. Since your combos rely on SQL cursors to show their content, instead of preparing SQL then setting their RowSourcetype as fields, let combos have RowSourceType = SQL and their Rowsource = "select ... into cursor myCursor". Of course cursorname would be different for each combo. Then all you need is to call a requery when SQL content should change :
RowSourcetype = SQL
RowSource = "select PatName,PIDCode "+;
"from Patient_ "+;
"where PIDCode = thisform.pgf.page1.TxtPIDCode.value "+;
"into cursor myPIDCode"
You could put this in init of combo. Leave combo properties for Rowsource* as (None) in designer. Their "requery" could be called in gotfocus of combo if needed :
this.requery(). If you do this right you would probably need no interactivechange code too (honestly I couldn't understand the purpose there).
Cetin