>I have a form with a listbox populated by a SQL
>SELECT statement with a condition. The cursor for
>the listbox is created manually in the Load of the
>form, then updated via the Requery method of the
>listbox whenever the user selects any of the
>options in a specific option group (the value of
>which sets the condition for the SELECT).
>
>The lsitbox is initially disabled and the value
>for the option group is initially empty.
>
>The very first time the user tries to set the
>value in the option group (which will enable the
>listbox), the requery method generates the message
>"Cannot access selected table". Observing the
>process with the Debug window, it appears that the
>cursor is initially in a 99999999.TMP file, the
>file number changing every time the Requery runs -
>except the first time, when it tries to put the
>cursor into the same file name (although that may
>be the result of selecting OK from the error
>message).
Charles
Sometimes we (me) overlook the obvious...
In the Controls INIT you new to specify the rowsource. Here is my code:
this.rowsource = ;
'select &lcLUFields ;
from &lcLUTable ;
&lcSQLWhere ;
into cursor &lcLUCursor ;
order by &lcLUKeyField'
Sorry Charlie...
Tom