Stinker somewhere (1 Viewer)

Malcy

Registered User.
Local time
Today, 01:07
Joined
Mar 25, 2003
Messages
586
I am trying to add some funtionality to a charity's database that I had nothing previously to do with. It was developed in ACC2003 and I am working with ACC2007 but still as an .mdb file
Mostly I have managed to do what I need but on this one I get an "Operation is not supported for this type of object". I have attached jpg with the code and also the references for the db.
dbs is properly called as a DAO.database and rstCbt is as a DAO.recordset. It keels over on the line rstCbt.FindFirst
The code looks OK to me but possibly I am simply missing something simple.
First thing I checked was references since the db is a bit of a mess but as far as I can see they look OK and are not showing anything as missing.
I have not come across this before and wonder if anyone has got any ideas where I might look.
Any pointers would be most appreciated.
Thanks

Malcy
 

Attachments

  • VbaRefs.jpg
    VbaRefs.jpg
    99.1 KB · Views: 74

namliam

The Mailman - AWF VIP
Local time
Today, 02:07
Joined
Aug 11, 2003
Messages
11,695
I think you can only use findfirst on a table recordset, usint the "dbOpenTable" as part of the argument.

If you leave that part blank I think it defaults to a Dynaset or something that doesnt support it....

I THINK...
 

LPurvis

AWF VIP
Local time
Today, 01:07
Joined
Jun 16, 2008
Messages
1,269
That's close - just flip it. ;-)

The default depends upon the type of table you're dealing with.
If the table is a local, native Jet table then the standard recordset type upon opening the table as the source is a TableType.
i.e.
Currentdb.OpenRecordset("tblLocalTableName")

If you used a query or SQL
Currentdb.OpenRecordset("SELECT * FROM tblLocalTableName")
then Dynaset is the default again.

If the table is linked then dynaset will be the default regardless
i.e. even with
Currentdb.OpenRecordset("tblLinkedTableName")

You can, of course as mentioned, specify the type to open.
It's a good idea to - to be explicit and work with local and then split apps the same during testing and live etc...

FindFirst isn't supported in TableTypes.
You need to specify a Dynaset (or Snapshot if you don't need to update and it makes sense to).

Cheers.
 

Malcy

Registered User.
Local time
Today, 01:07
Joined
Mar 25, 2003
Messages
586
Thanks guys
As soon as I put
Code:
,  dbOpenDynaset
after the table name it worked a treat.
Much apprecaiate the help - kicking myself too since as soon as I came to it I recalled visiting this issue once before some time ago - must be getting old :)
 

Users who are viewing this thread

Top Bottom