General information
Category:
Forms & Form designer
>>>>>>>>I have a form with a pageframe on it. After I call my router class and come back, it sets page 2 to be active. If I then click on page 1, I get the error "Can't access the selected table". It has an OK button and a HELP button. No SUSPEND button. Using messageboxes, I narrowed down where it happens: between the deactivate of page 2 and the activate of page 1.
>>>>>>>>
>>>>>>>>What's in there? I don't have code in any of the other methods of either page, so even if there's an event that runs between the two, there's no code there to run.
>>>>>>>>
>>>>>>>>Also, after I click OK, the program continues running fine. If it couldn't find a table, it must not be an important one because there's no visible problems after that.
>>>>>>>>
>>>>>>>>I realize this is a hard one to answer without seeing the form, but I'm hoping someone out there has run into this before.
>>>>>>>>
>>>>>>>>Thanks,
>>>>>>>>
>>>>>>>>-Michelle
>>>>>>>
>>>>>>>One possible reason for such message is recollected Combo.Rowsource.
>>>>>>
>>>>>>
>>>>>>There is a combobox on each of the pages. What do you mean by "recollected"?
>>>>>>
>>>>>>Thanks,
>>>>>>
>>>>>>-Michelle
>>>>>
>>>>>If you base combo on cursor and recollect records to this cursor (e.g. SELECT_SQL fires from Page.Activate event) then it's safer to 'disconnect' combo from rowsource before SELECT (combo.rowsource="") and restore it after.
>>>>
>>>>I was hoping that was it, and I did actually set the rowsource for the combo in the activate, but it's still doing it.
>>>>
>>>>BUT, it DOES have something to do with the comboboxes since it worked when I took them off.
>>>>
>>>>Hmmmm....
>>>>
>>>>Thanks,
>>>>
>>>>-Michelle
>>>
>>>So, you can remove them and then add them back step-by-step.
>>
>>I did. It's the code that sets the rowsource in the activate method that's doing it. But setting the rowsource to "" didn't help. Do you have any other ideas? I don't know where else to put the code. I need it to remake the cursor when the page is activated.
>>
>>Thanks,
>>
>>-Michelle
>
>Try CREATE CURSOR ..., SELECT INTO ARRAY and then INSERT INTO ... FROM ARRAY
Oh, like with grids and listboxes? I didn't know combos were fussy, too. I'll try that. Thanks,
-Michelle
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only