Select RecordSource Statement Leading to an Error 2486

  • Thread starter Thread starter Brad P
  • Start date Start date
B

Brad P

I have a Select Case statement that executes on the 'On Change' event of a
tab control. Depending on the tab selected, the current tab page's subform
has its record source assigned, as shown here as an example:

Me.subfrm_Activity.Form.RecordSource = "SELECT tbl_Activity.ActivityLifeID,
etc etc

When the tab control page is changed, the current record source is removed
from that subform and another subform is assigned its record source. Why did
I do this? I was designing another component and while doing so, I had an
error that too many tables were open. So I decided to control record sources
myself to limit the number of tables opened at any one time.

Anywho, once the tab is changed, and I perform another operation in the
application, I get an error 2486 Can not carry out this action at present
time. It halts on DoCmd statements. I discovered that removing the
RecordSource lines on the Change Event of the tab eliminated the error.

Can anyone help me here?

Thanks
 
I've narrowed it down to:

Me.subfrm_Activity.Form.RecordSource = ""
Me.subfrm_TimeExpense.Form.RecordSource = ""
Me.subfrm_TickerEdit.Form.RecordSource = ""

Select Case TabName
Case "Activities"
Me.subfrm_Activity.Form.RecordSource = "SELECT
tbl_Activity.ActivityLifeID, tbl_Activity.Date etc
Case "Time Expense" etc etc


The problem involves removing the record sources at the beginning of the
procedure. Then assigning them afterwards. Removing the lines that remove
the record sources OR removing the assigning of the record sources
eliminates the error 2486.
 
Back
Top