Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot access the selected table

Status
Not open for further replies.

jjdavis

Technical User
Aug 27, 2002
17
0
0
US
Can anyone shed some light on my "Cannot access selected table error"? I am trying to run a form, click a button to run some code, and after it finishes open another form. I can't seem to trap the error. I step through the code and it goes through opening the form and runs the code in the Init Method and right when it hits the Refresh command and goes to the Read Events command, it gets this "Cannot access selected table" error which I assume is from the form that I am opening. After I click okay, it seems to work the way it is supposed to. And if I run the code slightly differently, I don't get the error. Even though it should be doing the exact same routine because I close all the tables before I run the code either way. Below is the code that I have in my startup form.

ThisForm.Release
CLOSE tables
do main
DO FORM working
 
If you have a grid, listbox, or a combobox on the
form and if one of the controls listed above looses the
connection to its table, you'll get this error.

Darrell
 
this may also happens if you try to SELECT an alias that cannot be found in the current data session.


kilroy [trooper]
philippines
"and that's what we call creativity..."
 
Thanks. I do think that my initial form is what is generating the error because I have some combo boxes that I am using cursors to supply the rowsource data.

I have tried putting the CLOSE TABLES in the Unload, QueryUnload, and Release Methods, but it doesn't seem to make a difference or I get an even more serious error.

The cursors are getting created in the Init method of the form and get refreshed in the Requry Method if the Combo box is clicked. Also, I am using RowsourceType = 6.
 
I solved my problem by setting the rowsource for those combo boxes to a null string before releasing the form. But is there an easier way?
 
I tried putting a CLOSE TABLES in the forms's Destroy Method, but it still gave me errors. The same ones plus some.
 
That's odd, because I close tables in the Destory on forms with combos all the time. At that point, all objects on the form should be gone. The Destroy fires after Unload, QueryUnload and Release. But if setting the RowSource to a null string works, then just keep doing it that way.


-BP (Barbara Peisch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top