Module for TOC

yippie_ky_yay

Registered User.
Local time
Today, 05:17
Joined
Jul 30, 2002
Messages
338
Hello all,

I needed to create a table of contents like in Q131588 on the microsoft site. I had no problem creating this in the Northwind db, but I can't seem to get it to work on my own.

When I do try, I get "error 13 - Type mismatch" and it focuses on where I try to open the table:
Set toctable = db.OpenRecordset("Table Of Contents", DB_OPEN_TABLE)

The only difference I ever noticed between creating it the first time for practice and the real time was when I declared toctable as Recordset. When I wrote it in Northwind, Recordset was offered by VB once - but when I wrote it the second time, "Recordset" was offered twice in a row?!? Does this mean anything?

Thanks - I appreciate all help (even clarification on why VB would offer "Recordset" twice)

-Sean
PS when I say that VB "offered" it I'm talking about the options that pop-up as you write code.
 
It sounds like you have both the ADO and DAO reference in your code. You can either remove the ADO reference or preceed the RecordSet with DAO.

Example

Dim rst as DAO.Recordset
 
You're good Travis!

I had tested an old module a while ago (written in Access 97) and it was still there. When I removed it, the second "Recordset" option was gone and everything works great now - thanks again!

-Sean
 

Users who are viewing this thread

Back
Top Bottom