Error 3014: Can't open any more tables 
Author Message
 Error 3014: Can't open any more tables

Hello,

After a few times executing this sub I get the message 'Error 3014: Can't
open any more tables'. Can somebody tell what is wrong with my code? (The
recordset of the data-control is initialized in the Form_load event)

Public Sub Sort(Fld As String)
   Me.DatContact.Recordset.Sort = Fld
   Set Me.DatContact.Recordset = Me.DatContact.Recordset.OpenRecordset()
End Sub

Quote:
>> DatContact is a data-control

Thanks,

Davy



Sun, 21 Jan 2001 03:00:00 GMT  
 Error 3014: Can't open any more tables
I had the same problem, my solution is below - although this is more complex
than your requirements you might find it useful as it will accept any data
control and field no (from a grid head click event ) and sort remembering
the direction and reversing it each time.

In essence you need to use the refresh  method on the data control before
using the openrecordset method.

Don't ask me why you need to do this though!

Public Sub SortGrid(DC As Data, ColIndex As Integer)
Dim Direction As String
DC.Refresh 'avoid error 3014
If ColIndex = Val(DC.Tag) Then
   If InStr(DC.Tag, "DESC") Then
        Direction = " ASC"
    Else
        Direction = " DESC"
    End If
Else
    Direction = " ASC"
End If
DC.Recordset.Sort = DC.Recordset.Fields(ColIndex).Name & Direction
Set DC.Recordset = DC.Recordset.OpenRecordset
DC.Tag = ColIndex & Direction 'remember settings
End Sub



Sat, 03 Feb 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Error 3014: Can't open any more tables

2. Please help: run-time error 3014-can't open any more tables

3. Error 3014: Can't open any more tables

4. Can't open any more tables error 3014

5. Can't open any more tables - 3014

6. ? 3014 Can't open any more tables - Click header to sort by column fails

7. Err 3014, can't open any more tables

8. Error 3014 (too many Tables open)

9. Run-time error 3014 - 'Cannot open any more tables'

10. Error 3014 "can't open any more tables" when using the visual basic data control

11. Error 3014 "can't open any more tables" when using the visual basic data control

12. Error 3014, Can't open any more tables????

 

 
Powered by phpBB® Forum Software