Error 3251: Operation is not supported for this type of object.

M

M Skabialka

I am using a subroutine to pass a recordset, then manipulate it as follows:
GetInfo rs, strInfoName
Sub GetInfo(rs As Recordset, strInfoName As String)

However, although rs.AddNew, making field changes, then rs.Update works,
this doesn't:

rs.FindFirst "[IDNum] =" & RecID
3251: Operation is not supported for this type of object.

I am trying to update some records, and add others. I can't update becuase
I can't get the records in focus.

I don't know what is causing this error.
I have tried a compact/repair.

Please help with this dilemma.
Thanks,
Mich
 
A

Allen Browne

What kind of recordset is rs?
DAO, or ADO?
The find methods are different.

If DAO, it can also make a difference whether it is a dbOpenDynaset type or
a dbOpenTable type.

An example that should work:
Dim rs As DAO.Recordset
Set rs = dbEngine(0)(0).OpenRecordset("Table1", dbOpenDynaset)
Call GetInfo(rs, "SomeOtherValueHere")
 
M

M Skabialka

Perfect!
Thank goodness there are experts like you around - what did we ever do
before newsgroups?
(I'm in a 1 man IT department!)
Thanks,
Mich

Allen Browne said:
What kind of recordset is rs?
DAO, or ADO?
The find methods are different.

If DAO, it can also make a difference whether it is a dbOpenDynaset type
or a dbOpenTable type.

An example that should work:
Dim rs As DAO.Recordset
Set rs = dbEngine(0)(0).OpenRecordset("Table1", dbOpenDynaset)
Call GetInfo(rs, "SomeOtherValueHere")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

M Skabialka said:
I am using a subroutine to pass a recordset, then manipulate it as
follows:
GetInfo rs, strInfoName
Sub GetInfo(rs As Recordset, strInfoName As String)

However, although rs.AddNew, making field changes, then rs.Update works,
this doesn't:

rs.FindFirst "[IDNum] =" & RecID
3251: Operation is not supported for this type of object.

I am trying to update some records, and add others. I can't update
becuase I can't get the records in focus.

I don't know what is causing this error.
I have tried a compact/repair.

Please help with this dilemma.
Thanks,
Mich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top