Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch

Status
Not open for further replies.

vlingen

Programmer
Aug 4, 2006
31
US
Hi -
I've used this code hundreds of time w/o a problem, but today is a new day. I keep getting a Type Mismatch error when I run:

Dim CurDb As Database
Dim rTmpNotes As Recordset
Dim sSQL As String

Set CurDb = DBEngine.Workspaces(0).Databases(0)

'open Temp Ship notes table
sSQL = "SELECT * FROM _TmpShipNotes"
Set rTmpNotes = CurDb.OpenRecordset(sSQL, dbOpenDynaset)


The error occurs on the last line.
Any suggestions would be WONDERFUL!

Thanks
 
Dim rTmpNotes As [!]DAO.[/!]Recordset

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That worked!

Thanks so much, but I don't understand. I've written the code as displayed many times in the past without any problems.

This time I'm dialed into a customer and suddenly I need the "DAO"

Thanks for you quick response.
 
Seems like you have a reference to, say, Microsoft ActiveX Data Objects 2.x Library, with higher precedence than the Microsoft DAO 3.X Object Library.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top