Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Problems accessing a table
I am setting the rowsource of a listbox in the gotfocus event of a form to cursor values.
thisform.list1.rowsource = "mycursor.amount"
I populate the cursor with sql the line before that, and it works fine when the gotfocusevent happens the first time. I then have the user leave the form (thisform.hide) with a right-click event which opens another form. When this new form is closed (it runs, edits, saves, ect no problems) I release it with thisform.release and show the previous form(the one with the listbox).
This time when it goes through the gotfocus event I get the error "cannot access the selected table" at
thisform.list1.rowsource = "mycursor.amount" line.
Even though I get the error everything appears in the list box and everything else on the form works fine, the rowsource is filled in by the refresh event called on the line after the rowsource line.
This only happens ONCE when the application is started and that form is run, and never appears again until it is restarted. It doesn't seem to have any negative effect on the the data either. I can't seem to find the problem...
I have another form in the same application that does the same thing with different data, and the code is exactly same. (other than variable names and sources for the data). It works fine and I have never had any problems accessing the cursor to get the rowsource.
I have tried too many things to list here, but any suggestions would be helpful!
thanks,
Paul
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement