Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Run-time error '3251'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Hidas - 25 Nov 2006 23:52 GMT
I am getting this error message at the FindFirst call in the following code.
Run-time error '3251':
Operation is not supported for this type of object.

Sub FillOneLCdetails(lcID As Long)
   
   Dim rstTSV As DAO.Recordset
   Dim strSQL As String
       
   Set rstTSV = CurrentDb.OpenRecordset("LaneChangeDetails")
   
   If rstTSV.EOF = False Then
       strSQL = "[ID] = " & lcID
       rstTSV.FindFirst strSQL
       If rstTSV.NoMatch Then
           MsgBox "No records found with " & strSQL
       End If
   '..... etc .....
   
   
MS DAO 3.6 Object Library is checked in Available References

Can someone tell me what's wrong?
(The strange thing is that the same code was working last year, I don't
understand...)

Thanks
Brendan Reynolds - 26 Nov 2006 16:57 GMT
If 'LaneChangeDetails' is a local (not linked) table, then you'll need to
specify the recordset type ...

   Set rstTSV = CurrentDb.OpenRecordset("LaneChangeDetails", dbOpenDynaset)

The default for local tables is dbOpenTable, which results in a recordset
that does not support FindFirst. The default for linked tables and for
queries is dbOpenDynaset, which may explain why similar code has worked for
you before.

Signature

Brendan Reynolds
Access MVP

>I am getting this error message at the FindFirst call in the following
>code.
[quoted text clipped - 23 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.